@plugdash/callout

callout

240 words·2min read

What it does

Registers a callout block type in the EmDash Portable Text editor. Authors pick one of four variants - info, warning, tip, danger - and optionally add a title. Ships Callout.astro for rendering in your theme.

callout is a Native plugin (it registers an editor block) - it runs unsandboxed.

Install

npm install @plugdash/callout

Register

Open astro.config.mjs at the root of your Astro project. Import the plugin at the top, then add it to the plugins array of the emdash() integration - the one that sits inside Astro's top-level integrations array:

// astro.config.mjs
import { defineConfig } from "astro/config"
import emdash from "emdash/astro"
import { calloutPlugin } from "@plugdash/callout"

export default defineConfig({
  integrations: [
    emdash({
      plugins: [calloutPlugin()],
    }),
  ],
})

Add the component

Use the component in your Portable Text renderer for blocks with _type === "callout":

import Callout from "@plugdash/callout/Callout.astro"
<Callout variant="info" title="Heads up">
  <p>Content goes here.</p>
</Callout>

Live demo

Props

proptypedefaultdescription
variant"info" | "warning" | "tip" | "danger""info"Visual tone
titlestringOptional heading

CSS custom properties

tokendescription
--plugdash-callout-radiusBorder radius
--plugdash-callout-paddingInner padding
--plugdash-callout-border-widthBorder thickness

For agents

After install, open the EmDash admin editor and confirm the callout block type appears in the block menu. The plugin does not write metadata - it only registers the block type.

built with plugdash