Skip to content
Calm motion: animations on this site only fade, with no movement

Editor ​

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

A rich-text surface for the cases a BlessTextarea cannot 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"
labelsPartial<Record<"bold" | "strike" | "code" | "italic" | "h1" | "h2" | "h3" | "bulletList" | "orderedList" | "blockquote" | "codeBlock" | "hr" | "undo" | "redo", string>>—rename tools by key: `{ bold: "Tebal", h1: "Judul 1" }`
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.