escwxyz

payload callouts

by escwxyz
Rich text & editors
v3
^3.55.1
MIT

Overview

Summary generated from the README

Adds a configurable callout block that you register in the Lexical BlocksFeature of a rich text field. It ships GitHub and Obsidian callout types with icons and CSS-module styling, and provides JSX converters for rendering the block on the frontend. Requires Payload 3.55.1 or later.

Features

  • GitHub theme with note, tip, important, warning and caution types
  • Obsidian theme with many types such as abstract, todo, success, question and danger
  • Nested rich text content inside each callout
  • Optional collapsible callouts with a configurable default open state
  • Configurable block slug and TypeScript interface name
  • Frontend JSX converter and CSS custom properties for styling

Use cases

  • Highlight warnings and tips inside blog posts or documentation written in Payload
  • Reproduce Obsidian-style callouts when publishing notes as site content

From the author

A server rendered callout block component with builtin Obsidian & GitHub themes for Payload CMS

Installation

npm i payload-callouts

1

Stars

0

Forks

2

Open Issues

1 years ago

Last Updated

9

Weekly Downloads

v0.0.1

npm Version

83.8 KB

Unpacked Size

0

Dependencies

GitHub stars

10 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20261
Dec 4, 20261
Dec 3, 20261
Dec 2, 20261
Dec 1, 20261
Nov 30, 20261
Nov 29, 20261
Nov 28, 20261
Nov 27, 20261
Nov 26, 20261
Nov 25, 20261
Nov 24, 20261
Nov 23, 20261
Nov 22, 20261
Nov 21, 20261
Nov 20, 20261
Nov 19, 20261
Nov 18, 20261
Nov 17, 20261
Nov 16, 20261
Nov 15, 20261
Nov 14, 20261
Nov 13, 20261
Nov 12, 20261
Nov 11, 20261
Nov 10, 20261
Nov 9, 20261
Nov 8, 20261
Nov 7, 20261
Nov 6, 20261
Nov 5, 20261
Nov 4, 20261
Nov 3, 20261
Nov 2, 20261
Nov 1, 20261
Oct 31, 20261
Oct 30, 20261
Oct 29, 20261
Oct 28, 20261
Oct 27, 20261
Oct 26, 20261
Oct 25, 20261
Oct 24, 20261
Oct 23, 20261
Oct 22, 20261
Oct 21, 20261
Oct 20, 20261
Oct 19, 20261
Oct 18, 20261
Oct 17, 20261
Oct 16, 20261
Oct 15, 20261
Oct 14, 20261
Oct 13, 20261
Oct 12, 20261
Oct 11, 20261
Oct 10, 20261
Oct 9, 20261
Oct 8, 20261
Oct 7, 20261
Oct 6, 20261
Oct 5, 20261
Oct 4, 20261
Oct 3, 20261
Oct 2, 20261
Oct 1, 20261
Sep 30, 20261
Sep 29, 20261
Sep 28, 20261
Sep 27, 20261
Sep 26, 20261
Sep 25, 20261
Sep 24, 20261
Sep 23, 20261
Sep 22, 20261
Sep 21, 20261
Sep 20, 20261
Sep 19, 20261
Sep 18, 20261
Sep 17, 20261
Sep 16, 20261
Sep 15, 20261
Sep 14, 20261
Sep 13, 20261
Sep 12, 20261
Sep 11, 20261
Sep 10, 20261
Sep 9, 20261
Sep 8, 20261
Sep 7, 20261
Sep 6, 20261
npm weekly downloads

4−2 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 20264
Dec 4, 20264
Dec 3, 20263
Dec 2, 20263
Dec 1, 20264
Nov 30, 20264
Nov 29, 20265
Nov 28, 20265
Nov 27, 20265
Nov 26, 20265
Nov 25, 20265
Nov 24, 20263
Nov 23, 20263
Nov 22, 20263
Nov 21, 20263
Nov 20, 20263
Nov 19, 20264
Nov 18, 20266
Nov 17, 20266
Nov 16, 20268
Nov 15, 20266
Nov 14, 20268
Nov 13, 202610
Nov 12, 202612
Nov 11, 202610
Nov 10, 202610
Nov 9, 20269
Nov 8, 202610
Nov 7, 20268
Nov 6, 20265
Nov 5, 20262
Nov 4, 20262
Nov 3, 20263
Nov 2, 20264
Nov 1, 20264
Oct 31, 20264
Oct 30, 20264
Oct 29, 20264
Oct 28, 20264
Oct 27, 20264
Oct 26, 20262
Oct 25, 20262
Oct 24, 20263
Oct 23, 20263
Oct 22, 20265
Oct 21, 20265
Oct 20, 20264
Oct 19, 20264
Oct 18, 20263
Oct 17, 20263
Oct 16, 20263
Oct 15, 20262
Oct 14, 20262
Oct 13, 20262
Oct 12, 20262
Oct 11, 20263
Oct 10, 20262
Oct 9, 20262
Oct 8, 20261
Oct 7, 20261
Oct 6, 20261
Oct 5, 20261
Oct 4, 20260
Oct 3, 20261
Oct 2, 20263
Oct 1, 20263
Sep 30, 20263
Sep 29, 20265
Sep 28, 20265
Sep 27, 20266
Sep 26, 20268
Sep 25, 20266
Sep 24, 20266
Sep 23, 20266
Sep 22, 20266
Sep 21, 20266
Sep 20, 20266
Sep 19, 20263
Sep 18, 20263
Sep 17, 20264
Sep 16, 20265
Sep 15, 20263
Sep 14, 20265
Sep 13, 20265
Sep 12, 20268
Sep 11, 20268
Sep 10, 20267
Sep 9, 20267
Sep 8, 20267
Sep 7, 20267
Sep 6, 20266

Each point is npm's rolling 7-day download count.

Health Score

23/100Poor

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1058387210-root.svg)](https://payloaddirectory.dev/plugins/1058387210-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1058387210-root"><img src="https://payloaddirectory.dev/badge/1058387210-root.svg" alt="Payload Directory"></a>
Updated Oct 1, 2025Created Sep 17, 2025Published Sep 17, 2025

README

Payload Callouts Plugin

A Payload CMS plugin for creating beautiful callout blocks with GitHub and Obsidian themes.

github obsidian

Features

Multiple Themes: GitHub and Obsidian-style callouts
Rich Styling: Pre-designed callout types with icons
Rich Text Support: Full RichText editor support with nested content
Configurable: Collapsible callouts with customizable defaults

Supported Callout Types

GitHub Theme

  • Note - General information
  • Tip - Helpful suggestions
  • Important - Critical information
  • Warning - Cautionary content
  • Caution - Danger alerts

Obsidian Theme

  • Note - General notes
  • Abstract/Summary/Tldr - Content summaries
  • Info - Information blocks
  • Todo - Task lists
  • Tip/Hint - Helpful suggestions
  • Important - Critical content
  • Success/Check/Done - Completion status
  • Question/Help/FAQ - Q&A content
  • Warning/Attention/Caution - Warnings
  • Failure/Missing/Fail - Error states
  • Danger/Error/Bug - Critical errors
  • Example - Code examples
  • Quote/Cite - Quotations

Installation

npm install payload-callouts
# or
yarn add payload-callouts
# or
pnpm add payload-callouts

Setup

1. Configure the Plugin

Add the plugin to your Payload configuration:

// payload.config.ts
import { payloadCallouts } from 'payload-callouts'

export default buildConfig({
  plugins: [
    payloadCallouts({
      theme: 'github', // or 'obsidian'
      blockSlug: 'callout', // optional, default: 'callout'
      blockInterfaceName: 'CalloutBlock', // optional, default: 'CalloutBlock'
      collapsible: true, // optional, default: true
      defaultOpen: true, // optional, default: true
    }),
  ],
  // ... rest of your config
})

2. Add the Block to Your Collections

// collections/Posts.ts
import { createBlockConfig } from 'payload-callouts'

export const Posts: CollectionConfig = {
  slug: 'posts',
  fields: [
    {
      name: 'content',
      type: 'richText',
      editor: lexicalEditor({
        features: ({ rootFeatures }) => [
          ...rootFeatures,
          BlocksFeature({
            blocks: [
              createBlockConfig(), // Add callout blocks
              // ... other blocks
            ],
          }),
        ],
      }),
    },
  ],
}

3. Setup Frontend Rendering

Create a RichText component with callout converters:

// components/RichText.tsx
import { createCalloutBlockJSXConverter } from 'payload-callouts/converters'
import {
  RichText as ConvertRichText,
  type JSXConvertersFunction,
} from '@payloadcms/richtext-lexical/react'

const jsxConverters: JSXConvertersFunction = ({ defaultConverters }) => {
  
  const calloutBlockConverter = createCalloutBlockJSXConverter((content) => (
    {/* Passing your customized RichText / ConvertRichText component */}
    <ConvertRichText converters={jsxConverters} data={content} />
  ));

  return {
    ...existingConverters,
    blocks: {
      ...existingConverters.blocks,
      ...calloutBlockConverter.blocks,
    },
  };
}

export default function RichText(props) {
  return (
    <ConvertRichText
      className="prose dark:prose-invert max-w-none"
      converters={jsxConverters}
      {...props}
    />
  )
}

Configuration Options

interface PayloadCalloutsConfig {
  /** Enable or disable the plugin */
  disabled?: boolean
  
  /** The slug for the callout block */
  blockSlug?: string // default: 'callout'
  
  /** Interface name for TypeScript generation */
  blockInterfaceName?: string // default: 'CalloutBlock'
  
  /** Theme to use */
  theme?: 'github' | 'obsidian' // default: 'github'
  
  /** Whether callouts are collapsible by default */
  collapsible?: boolean // default: true
  
  /** Whether callouts are open by default */
  defaultOpen?: boolean // default: true
}

Styling

The plugin includes CSS modules for styling. You can customize the appearance by:

  1. Using CSS Custom Properties: Override the built-in CSS variables
  2. Custom CSS: Import and modify the provided styles
  3. Tailwind Classes: Add additional classes to the rendered components

CSS Custom Properties

:root {
  /* add the following line if you want dark mode support */
  color-scheme: light dark; 
  --callout-border-radius: 8px;
  --callout-padding: 1rem;
  /* ... more variables */
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

Credits

Part of the CSS styles are from rehype-callouts.

Similar plugins