RichTextEditor
Basic rich text editor with formatting toolbar
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { RichTextEditor } from '@dryui/ui';
</script>
<RichTextEditor.Root>
<RichTextEditor.Toolbar>...</RichTextEditor.Toolbar>
<RichTextEditor.Content>...</RichTextEditor.Content>
</RichTextEditor.Root>Import options
Root package
import { RichTextEditor } from '@dryui/ui'Per-component subpath
import { RichTextEditor } from '@dryui/ui/rich-text-editor'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Basic Editor
<RichTextEditor.Root placeholder="Start typing...">
<RichTextEditor.Toolbar />
<RichTextEditor.Content />
</RichTextEditor.Root>With Initial Value
<RichTextEditor.Root value="<p>Initial <strong>content</strong> here.</p>">
<RichTextEditor.Toolbar />
<RichTextEditor.Content />
</RichTextEditor.Root>Readonly
<RichTextEditor.Root value="<p>This content is <strong>readonly</strong>.</p>" readonly>
<RichTextEditor.Content />
</RichTextEditor.Root>Structure
Compound components always start with RichTextEditor.Root. Use this structure block to understand required wrappers before you wire state or styling.
RichTextEditor.Root RichTextEditor.Toolbar RichTextEditor.Content
Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with RichTextEditor.Root, then add only the parts you need.
RichTextEditor.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
value | string | '' | — | ✓ |
placeholder | string | — | — | — |
readonly | boolean | — | — | — |
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
RichTextEditor.Toolbar
| Prop | Type | Default | Required | Bindable |
|---|
Forwards <div> attributes via rest props. Common examples: id, style, role.
RichTextEditor.Content
| Prop | Type | Default | Required | Bindable |
|---|
Forwards <div> attributes via rest props. Common examples: id, style, role.