Skip to content

Editor ​

Rich text: a token-styled toolbar around a Tiptap editor

A rich-text surface for the cases a BlessTextarea can't cover — headings, lists, code, quotes. The library ships the frame: a toolbar in the system's style and content typography from tokens. The engine is Tiptap, which you install and configure yourself; the component only needs the editor from useEditor() and renders your <EditorContent> in its default slot.

Reach for it only when users must produce formatted text. For comments, notes and messages a textarea is lighter and easier to store.

tools is the toolbar, in order, with "|" as a separator; the #toolbar slot ({ editor }) replaces it entirely for custom buttons. The toolbar is a single tab stop — ← / → move between tools, Home / End jump — and each tool reports aria-pressed; an applied format fills with the accent, like a pressed Toggle. Inside the writing area, Tiptap's own shortcuts apply (⌘B, ⌘I, …). minHeight sets the writing area; its typography reads the --bless-* tokens.

Basic

Install ​

Tiptap is an optional peer — the library only types against it and never imports it.

sh
pnpm add @tiptap/vue-3 @tiptap/starter-kit @tiptap/pm

Usage ​

ts
import { BlessEditor } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
editor*BlessEditorLike | null—the Tiptap editor from useEditor(); the content goes in the default slot as <EditorContent :editor />
toolsBlessEditorTool[][ "bold", "italic", "strike", "code", "|", "h1", "h2", "|", "bulletList", "orderedList", "blockquote", "codeBlock", "hr", "|", "undo", "redo", ]
labelstring"Formatting"
disabledboolean—
minHeightstring"160px"min height of the writing area

Slots

NameScopeDescription
toolbar{ editor: BlessEditorLike | null | undefined; }
default—
footer{ editor: BlessEditorLike | null | undefined; }

Released under the MIT License. Character names and artwork belong to their owners.