Launch price: lifetime access for $149, $199 after

Rich Text Editor

Headings, bold, italic, lists, quotes, code and links, with the toolbar as a single tab stop and arrow keys inside it. Links are edited in an inline field instead of a browser prompt. Outputs HTML.

FormsFree224 lines · one file

The decision inside it

No window.prompt for links

A prompt blocks the page, cannot be styled and loses the selection on some browsers. The link field opens in the toolbar and keeps the selection it applies to.

Installation

How you get it

One command. The CLI writes the file into components/ui/ and installs what it needs.

npx shadcn@latest add https://layropro.com/r/rich-text-editor

API

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
defaultValuestring—
onChange(html: string, editor: Editor) => voidHTML on every change.
placeholderstring—
maxLengthnumber—
minHeightnumberMinimum height of the writing area in px. Default 140.
toolsArray<"heading" | "bold" | "italic" | "strike" | "code" | "bullet" | "ordered" | "quote" | "link" | "history">Which tools to show. Default: all.
editableboolean—
labelstringAccessible name for the writing area.
classNamestring—

Dependencies

npm packages

@tiptap/extension-character-count@tiptap/extension-link@tiptap/extension-placeholder@tiptap/react@tiptap/starter-kitclsxlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themetooltip

Lifetime access

Every component, and everything we ship next.

  • All 65 components, source included
  • The template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.

More in Forms