Demo

Block Editor

Documented in Block Editor.

Block Editor

A controlled BlockEditor with checklists, a callout, nested lists, code, mentions and labels; the block JSON and the block events update as you edit.

Launch plan

Type / for blocks, select text for the toolbar, or drag the handle to reorder.

Tasks

  • Write the announcement

  • Review with @Ana Lima

Ship after the docs are live.

  1. Freeze the release branch

    • Tag #release

  2. Publish the packages

import { BlockEditor } from '@salmonui/rich-text';
Value (9 top-level blocks)
[
  {
    "id": "title",
    "type": "heading",
    "props": {
      "level": 2
    },
    "content": [
      {
        "type": "text",
        "text": "Launch plan"
      }
    ]
  },
  {
    "id": "intro",
    "type": "paragraph",
    "content": [
      {
        "type": "text",
        "text": "Type "
      },
      {
        "type": "text",
        "text": "/",
        "marks": [
          {
            "type": "code"
          }
        ]
      },
      {
        "type": "text",
        "text": " for blocks, select text for the toolbar, or drag the handle to reorder."
      }
    ]
  },
  {
    "id": "goals",
    "type": "heading",
    "props": {
      "level": 2
    },
    "content": [
      {
        "type": "text",
        "text": "Tasks"
      }
    ]
  },
  {
    "id": "t1",
    "type": "checklistItem",
    "props": {
      "checked": true
    },
    "content": [
      {
        "type": "text",
        "text": "Write the announcement"
      }
    ]
  },
  {
    "id": "t2",
    "type": "checklistItem",
    "props": {
      "checked": false
    },
    "content": [
      {
        "type": "text",
        "text": "Review with "
      },
      {
        "type": "mention",
        "id": "ana",
        "label": "Ana Lima",
        "trigger": "@"
      }
    ]
  },
  {
    "id": "note",
    "type": "callout",
    "props": {
      "tone": "warning"
    },
    "content": [
      {
        "type": "text",
        "text": "Ship after the docs are live."
      }
    ]
  },
  {
    "id": "steps",
    "type": "numberedListItem",
    "content": [
      {
        "type": "text",
        "text": "Freeze the release branch"
      }
    ],
    "children": [
      {
        "id": "steps-a",
        "type": "bulletListItem",
        "content": [
          {
            "type": "text",
            "text": "Tag "
          },
          {
            "type": "label",
            "id": "release",
            "label": "release",
            "trigger": "#",
            "tone": "info"
          }
        ]
      }
    ]
  },
  {
    "id": "steps2",
    "type": "numberedListItem",
    "content": [
      {
        "type": "text",
        "text": "Publish the packages"
      }
    ]
  },
  {
    "id": "code",
    "type": "code",
    "props": {
      "language": "ts"
    },
    "content": [
      {
        "type": "text",
        "text": "import { BlockEditor } from '@salmonui/rich-text';"
      }
    ]
  }
]
No events yet.