UI.MD

Rich Text Editor

A rich text editor built on Tiptap with bold, italic, and link support.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/rich-text-editor.json

Usage

import { RichTextEditor } from "@/components/ui/rich-text-editor"

Examples

Default

Bold, italic, and links, with a toolbar above the writing area. value and onChange deal in HTML strings, not markdown, so store what you get back as-is.

API Reference

PropTypeDefaultDescription
value*string-The editor content as an HTML string.
onChange*(value: string) => void-Called with the updated HTML string on every edit.
onBlur() => void-Called when the editor loses focus.
placeholderstring-Placeholder text shown when the editor is empty.
classNamestring-Extra classes for the editor's outer container.