Rich Text Editor

A complete rich text editor block: every node, every mark, the toolbar, the bubble menu and the character count.

Blocksrich-text-editor-blockView JSON

The block installs a single file and depends on the editor shell, every node, every mark and the extension items it composes, so the CLI brings a working editor. Replace `defaultValue` with the content your app edits. The unique id item is not part of the composition: it writes an attribute to every block on load, which a controlled editor would echo back before the first edit.

Preview

0 characters

Installation

Add the item with the shadcn CLI, or copy the source manually.

pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-block

Requires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.

Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/rich-text-editor-block

This example also uses: rich-text-editor-headingrich-text-editor-code-blockrich-text-editor-detailsrich-text-editor-imagerich-text-editor-tablerich-text-editor-blockquoterich-text-editor-listrich-text-editor-emojirich-text-editor-mathematicsrich-text-editor-mentionrich-text-editor-boldrich-text-editor-italicrich-text-editor-underlinerich-text-editor-strikerich-text-editor-coderich-text-editor-linkrich-text-editor-highlightrich-text-editor-rubyrich-text-editor-subscriptrich-text-editor-superscriptrich-text-editor-text-stylerich-text-editor-behaviorrich-text-editor-typographyrich-text-editor-invisible-charactersrich-text-editor-find-and-replacerich-text-editor-file-handlerrich-text-editor-drag-handle

pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-heading litingyes/blocove/rich-text-editor-code-block litingyes/blocove/rich-text-editor-details litingyes/blocove/rich-text-editor-image litingyes/blocove/rich-text-editor-table litingyes/blocove/rich-text-editor-blockquote litingyes/blocove/rich-text-editor-list litingyes/blocove/rich-text-editor-emoji litingyes/blocove/rich-text-editor-mathematics litingyes/blocove/rich-text-editor-mention litingyes/blocove/rich-text-editor-bold litingyes/blocove/rich-text-editor-italic litingyes/blocove/rich-text-editor-underline litingyes/blocove/rich-text-editor-strike litingyes/blocove/rich-text-editor-code litingyes/blocove/rich-text-editor-link litingyes/blocove/rich-text-editor-highlight litingyes/blocove/rich-text-editor-ruby litingyes/blocove/rich-text-editor-subscript litingyes/blocove/rich-text-editor-superscript litingyes/blocove/rich-text-editor-text-style litingyes/blocove/rich-text-editor-behavior litingyes/blocove/rich-text-editor-typography litingyes/blocove/rich-text-editor-invisible-characters litingyes/blocove/rich-text-editor-find-and-replace litingyes/blocove/rich-text-editor-file-handler litingyes/blocove/rich-text-editor-drag-handle
Typography is provided by shadcn/typeset. Copy typeset.css next to your stylesheet, import it after Tailwind and add the .typeset-docs preset. See the Rich text editor setup.

Usage

Use the block
import { RichTextEditorBlock } from "@/components/blocove/rich-text-editor-block"
export function DocumentEditor() {  return (    <RichTextEditorBlock      defaultValue="<p>Start writing…</p>"      onChange={html => console.log(html)}    />  )}

API Reference

Props accepted by the exported components.

RichTextEditorBlock

The editor with every Blocove node, mark and control already composed, grouped by kind in the toolbar.

PropTypeDefault
defaultValuestringBuilt-in demo document
placeholderstring"Start writing…"
characterLimitnumber-
onChange(html: string) => void-
classNamestring-