A headless rich text editor. Your UI, our engine.
The editing core with no toolbar. Your own buttons run commands, and a live state object keeps them in sync.
Details
Some products need an editor that looks like the rest of the product, not like an editor. The headless entry gives you the editing surface, commands, undo history and output formats, and leaves every button, menu and panel to your design system.
You own the interface.
The whole API on one screen
Mount the core on your own element, then drive it. state() and the update event tell your buttons when to show as pressed or disabled.
import { createHeadlessEditor } from "@richscripts/richtexteditor/headless";
const editor = await createHeadlessEditor("#host", { value: "<p>Hello</p>" });
editor.run("bold"); // run a command from your own button
editor.run("formatblock", "h1"); // block types go through formatblock
editor.isActive("bold"); // true or false, for your button state
editor.can("undo"); // is the command available?
editor.state(); // { bold, italic, ..., canUndo, canRedo }
editor.on("update", (s) => renderToolbar(s));
editor.getHTML(); // publish-ready markup
editor.getJSON(); // structured document model
editor.getMarkdown();
editor.getStatistics(); // { words, characters }The editor loads its runtime files from /richtexteditor; pass assetBasePath to change that, or autoload: false if the page already loads them.
In React, Vue and Svelte
The same core is behind the useRichTextEditor hook on the React page, the useRichTextEditor composable on the Vue page, and the Svelte action. Those bindings cancel a pending start and clean up when the component unmounts.
Views that open and close
In a single-page app a view can close before the editor has finished loading. Pass an AbortSignal to cancel that start without affecting other editors on the page, and call destroy()when a mounted editor’s view closes.
const pending = new AbortController();
const initialization = createHeadlessEditor("#host", { signal: pending.signal });
// If the view closes before the editor is ready: pending.abort();
const controller = await initialization;
// Once mounted, call controller.destroy() when the view closes.Headless framework or headless mode?
- A headless framework such as Tiptap or Lexical gives you building blocks, and you assemble the editor from them. You get full control of the document model, and you write more of the editor yourself.
- This is a complete editor with a headless entry. You build the interface; editing, commands and output already work. If you later want the standard toolbar for an admin screen, it is the same package.
- The selection toolbar can still appear. The full editor shows a floating toolbar on a text selection. The headless demo hides it with one CSS rule; do the same if your design does not want it.
- In every license, from $129 one-time, with no per-seat pricing. See pricing.