Skip to content
FrameworkJavaScript

Callout block: highlighted notes

A container block for highlighted content with an emoji icon. Supports customisable text and background colours via a colour picker. Child blocks are nested inside the callout. Useful for tips, warnings, notes, and other call-to-action content.

Import

TypeScript
import { Callout } from '@bloklabs/core/tools';

Configuration

OptionTypeDefaultDescription
emojiPicker(onSelect: (emoji: string) => void) => voidundefinedCustom emoji picker handler that replaces the built-in picker. Call `onSelect` with the chosen emoji, or "" to clear.

Save Data

TypeScript
interface CalloutData {
  emoji: string;             // Emoji character (e.g. "💡")
  textColor: string | null;  // Colour preset name, or null for default
  backgroundColor: string | null; // Colour preset name, or null for default
}
JSON
{
  "id": "pqr678",
  "type": "callout",
  "data": {
    "emoji": "💡",
    "textColor": null,
    "backgroundColor": "yellow"
  }
}

Usage Example

TypeScript
import { Blok } from '@bloklabs/core';
import { Callout } from '@bloklabs/core/tools';

const editor = new Blok({
  holder: 'editor',
  tools: {
    callout: {
      class: Callout,
    },
  },
});