Rich Text
A contenteditable editor with a selection-aware formatting toolbar. The Bold/Italic toggles apply inline formatting to the current selection, and their `aria-pressed` reflects the formatting at the caret — moving the selection updates the toolbar. Select some text in the preview and toggle formatting.
- Axe
- Name
- Roving
- Focus
- Paste
Preview
Installation
npx shadcn@latest add https://ui.publictheta.com/r/rich-text.jsonConformance
Verified against the @publictheta/ui-spec rich-text specification on both the React and vanilla reference implementations, across Chromium, Firefox, and WebKit.
- Axe — No WCAG 2 A/AA axe-core violations
- Name — The widget container exposes an accessible name
- Roving — Exactly one tab stop; Arrow keys move within the widget
- Focus — A visible focus indicator appears on keyboard focus (WCAG 2.4.7)
- Paste — A paste lands: the widget takes the richest flavour it understands, never injects markup it did not ask for, and pastes as plain text on Shift+Cmd/Ctrl+V
See the full conformance matrix across all components.