Signature pad
Smooth ink that thins with speed, with undo, replay, and PNG or SVG export.
A lightweight editor with markdown shortcuts, a floating toolbar, a slash menu, and HTML and markdown output.
npx shadcn@latest add @silicon-ui/rich-text-editornpx shadcn@latest add @silicon-ui/rich-text-editorInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/rich-text-editor/rich-text-editor.tsxcomponents/silicon-ui/rich-text-editor/rich-text-editor.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
valueControlled HTML. The editor only rewrites its content when this differs from what it last emitted. | string | — |
defaultValue | string | — |
defaultMarkdownInitial content as Markdown, used when no HTML value is given. | string | — |
onChange | (value: RichTextValue) => void | — |
onHistoryChangeReports whether undo and redo are available, for your own toolbar. | (state: { canUndo: boolean; canRedo: boolean }) => void | — |
placeholder | string | "Start writing" |
blockHintThe hint on an empty line while typing. | string | "Type / for blocks" |
readOnly | boolean | false |
autoFocus | boolean | false |
aria-label | string | — |
className | string | — |
style | CSSProperties | — |
Also accepts the props of HTMLAttributes.