1 | |
A contenteditable editor whose formatting toolbar appears when you select text, in a boxed (primary) or chrome-less (ghost) variant.
| Prop | Type | Default |
|---|---|---|
variant
`primary` (default, boxed fill) or `ghost` (chrome-less).
|
String | "primary" |
formats
Subset of FORMATS to offer, in toolbar order. `nil` uses the full set; an empty array hides the toolbar. Include "link" for the insert/remove-link controls.
|
Array | nil |
placeholder
Hint shown while the editor is empty.
|
String | nil |
disabled
Renders the editor read-only (not contenteditable).
|
Boolean | false |
name
When set, the editor's content is serialized to semantic HTML — `<p>`/`<ul>`/`<ol>` blocks; `<strong>`/`<em>`/`<s>`/ `<a href>`/`<br>` inline; mention chips preserved verbatim; no other tags or attributes — and mirrored into a hidden input with this `name` so it submits with a form. Omit for a purely presentational editor.
|
String | nil |
value
Initial HTML, used when no content block is given — seeds both the editor and the hidden input. The caller owns sanitizing this markup (it's rendered as-is); legacy markup is normalized to the serialized grammar on connect.
|
String | nil |
mentions_url
When set, typing `@` opens a suggestion menu sourced from `GET <mentions_url>?q=<query>` (expects JSON `[{label, html}]`). Selecting an item inserts its `html` verbatim — an opaque, inert (`contenteditable="false"`) node the consumer provides. Omit for no mention behaviour (the default).
|
String | nil |
**html_options
Any extra HTML attributes (data-*, aria-*, …).
|
Hash | — |