A contentEditable rich text input with trigger-based chips, inline markdown, undo/redo, and list auto-formatting. Built as a shadcn registry component.
Try It
All capabilities in one editor. / commands (start of line, inline style), @ mentions (pill style), # tags (auto-resolve on space), ! callback mode. Cmd+B bold, Cmd+I italic, Ctrl+Z/Ctrl+Shift+Z undo/redo. Type - for lists, paste a URL for auto-linking, or use the buttons below to call the imperative API. Enter to submit, Escape to dismiss.
[]
All Options
Every prop and option in a single example. Toggles for disabled, markdown, and autoGrow. All 4 trigger types (/ start-of-line dropdown, @ pill dropdown, # auto-resolve on space, ! callback mode). Every callback (onSubmit, onEscape, onChipClick, onChipAdd, onChipDelete, onLinkClick, onPaste, onUndo, onRedo) logs to the event panel. Imperative handle methods (focus, blur, insertChip, getPlainText, clear) are wired to buttons. Also sets minHeight, maxHeight, className, aria-label, and data-test-id.
[
{
"type": "text",
"text": "Hello "
},
{
"type": "chip",
"trigger": "@",
"value": "alice",
"displayText": "Alice"
},
{
"type": "text",
"text": " — click a chip, paste text, or try every feature!"
}
]Examples
Async Search
Type @ to trigger an async search with 300ms debounce, AbortSignal cancellation, and an empty-state message. Results load after a simulated 500ms delay.
Markdown Formatting
Wrap text in **bold**, *italic*, or ***both*** to see inline styling. Use Cmd+B / Cmd+I shortcuts. Start a line with - or * for auto-formatted lists (Tab to indent).
Copy & Paste
Select content with chips in the source editor and Cmd+C to copy, then Cmd+V in the target to paste — chips are preserved. Pasting plain text like @alice #bug from outside auto-resolves matching triggers.
Image Attachments
Paste an image (screenshot or file) to attach it. Images show a loading spinner during upload simulation. Click × to remove. Use imagePosition to control placement.
File Attachments
Attach files with icon, name, and metadata. Cards show a file-type icon, truncated filename, and extension/size. With 4+ files, only the first 3 are shown with a “+N more” button to expand. Click × to remove.
Action Bar
A horizontal toolbar with left and right slots. Pairs with PromptArea for a complete chat input experience. Independently installable.
Full-Featured
Left slot with attach menu (+), @ mention, / command, and # tag buttons. Right slot with markdown toggle, microphone, and send button. The send button submits the message just like pressing Enter.
Dark Theme
Toggle between light, dark, and system themes using the switch in the sidebar. All components adapt automatically via CSS variables.