Editor
The frame of a rich text editor: its toolbar, its document and their states.
On this page
An editor is the frame of a rich text field: the well of an input, a toolbar laid flat in its top, and the document under it. The editing itself, the document model, the selection, the history and the keys, belongs to an engine such as Tiptap or ProseMirror, which makes editor-document editable and writes the editor's classes on the blocks it renders. Rich text puts Tiptap in it.
Editor
<div class="field w-full max-w(560) mx-auto"> <span id="notes-label">Release notes</span> <div class="editor" style="--editor-rows: 5"> <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="true"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M4.6667 3H8.3333C12.3333 3 12.3333 7.6667 8.3333 7.6667H4.6667M4.6667 3V13H9C13.3333 13 13.3333 7.6667 9 7.6667" /> </svg> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M6.6667 3L12.6667 3" /><path d="M3.3333 13L9.3333 13" /><path d="M9.6667 3L6.3333 13" stroke-linecap="butt" /> </svg> </button> <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="3" cy="4" r="0.5" fill="currentColor" stroke="none" /><path d="M6 4L13.5 4" /><circle cx="3" cy="8" r="0.5" fill="currentColor" stroke="none" /><path d="M6 8L13.5 8" /><circle cx="3" cy="12" r="0.5" fill="currentColor" stroke="none" /><path d="M6 12L13.5 12" /> </svg> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M9 4.3333L10 3.3333C11.0125 2.3208 12.6541 2.3208 13.6667 3.3333C14.6792 4.3459 14.6792 5.9875 13.6667 7L11.6667 9C10.6541 10.0125 9.0125 10.0125 8 9" /><path d="M9 4.3333L10 3.3333C11.0125 2.3208 12.6541 2.3208 13.6667 3.3333C14.6792 4.3459 14.6792 5.9875 13.6667 7L11.6667 9C10.6541 10.0125 9.0125 10.0125 8 9" transform="rotate(180 8 8)" /> </svg> </button> </div> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="notes-label" contenteditable="true"> <h2 class="editor-heading">Version 0.4</h2> <p class="editor-paragraph"> Category colors arrive: <strong>twenty-three palettes</strong>, each with a surface, a text, a line and a mark. </p> </div> </div></div>import BoldIcon from '@master/icons-react/native/16/soft/bold'import ItalicIcon from '@master/icons-react/native/16/soft/italic'import ListIcon from '@master/icons-react/native/16/soft/list'import LinkIcon from '@master/icons-react/native/16/soft/link'<div className="field w-full max-w(560) mx-auto"> <span id="notes-label">Release notes</span> <div className="editor" style={{ '--editor-rows': '5' } as React.CSSProperties}> <div className="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="true"> <BoldIcon className="icon" /> </button> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false"> <ItalicIcon className="icon" /> </button> <span className="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false"> <ListIcon className="icon" /> </button> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false"> <LinkIcon className="icon" /> </button> </div> <div className="editor-document" role="textbox" aria-multiline="true" aria-labelledby="notes-label" contentEditable="true"> <h2 className="editor-heading">Version 0.4</h2> <p className="editor-paragraph"> Category colors arrive: <strong>twenty-three palettes</strong>, each with a surface, a text, a line and a mark. </p> </div> </div></div><script> import BoldIcon from '@master/icons-svelte/native/16/soft/bold' import ItalicIcon from '@master/icons-svelte/native/16/soft/italic' import ListIcon from '@master/icons-svelte/native/16/soft/list' import LinkIcon from '@master/icons-svelte/native/16/soft/link'</script><div class="field w-full max-w(560) mx-auto"> <span id="notes-label">Release notes</span> <div class="editor" style="--editor-rows: 5"> <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="true"> <BoldIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false"> <ItalicIcon class="icon" /> </button> <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false"> <ListIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false"> <LinkIcon class="icon" /> </button> </div> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="notes-label" contenteditable="true"> <h2 class="editor-heading">Version 0.4</h2> <p class="editor-paragraph"> Category colors arrive: <strong>twenty-three palettes</strong>, each with a surface, a text, a line and a mark. </p> </div> </div></div><script setup>import BoldIcon from '@master/icons-vue/native/16/soft/bold'import ItalicIcon from '@master/icons-vue/native/16/soft/italic'import ListIcon from '@master/icons-vue/native/16/soft/list'import LinkIcon from '@master/icons-vue/native/16/soft/link'</script><template> <div class="field w-full max-w(560) mx-auto"> <span id="notes-label">Release notes</span> <div class="editor" style="--editor-rows: 5"> <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="true"> <BoldIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false"> <ItalicIcon class="icon" /> </button> <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false"> <ListIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false"> <LinkIcon class="icon" /> </button> </div> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="notes-label" contenteditable="true"> <h2 class="editor-heading">Version 0.4</h2> <p class="editor-paragraph"> Category colors arrive: <strong>twenty-three palettes</strong>, each with a surface, a text, a line and a mark. </p> </div> </div> </div></template>Without an engine this preview's document is the browser's own contenteditable: it takes typing, but not structure, and its toolbar does nothing.
#The frame
- It is a field. The well, its hover, its focus halo, its danger edge and its disabled ink are the input's, so a rich text field reads like the fields around it. The focus that raises the frame is the document's, so moving through the toolbar does not.
- The toolbar is a band.
editor-toolbaron a toolbar lays it flat in the top of the well, one inset in, so its corner nests in the well's, with a hairline under it. It wraps on a narrow editor. The toolbar behavior gives it one tab stop and the arrow keys. - The document grows. From
--editor-rowslines when it is empty, six by default, to--editor-max-rows, eighteen, then it scrolls inside the frame.
#What the document holds
The stylesheet never selects an element: the engine writes a class on each block, and only these are styled, inside the editor and nowhere else. It is not a typography for a page.
What the document holds
<div class="editor w-full max-w(560) mx-auto"> <div class="editor-document" role="textbox" aria-multiline="true" aria-label="Document" contenteditable="true"> <h2 class="editor-heading">A heading</h2> <p class="editor-paragraph"> A paragraph with <a class="editor-link" href="#content">a link</a>, <em>emphasis</em> and <code class="code">inline code</code>. </p> <h3 class="editor-subheading">A subheading</h3> <ul class="editor-list"> <li class="editor-item"> <p class="editor-paragraph">A list with bullets</p> </li> <li class="editor-item"> <p class="editor-paragraph">Its markers in the muted ink</p> </li> </ul> <ol class="editor-list editor-list-numbered"> <li class="editor-item"> <p class="editor-paragraph">A list with numbers</p> </li> <li class="editor-item"> <p class="editor-paragraph">On an ordered list</p> </li> </ol> <blockquote class="editor-quote"> <p class="editor-paragraph">A quotation, a step quieter.</p> </blockquote> <hr class="editor-rule"> <p class="editor-paragraph">And a paragraph after a rule.</p> </div></div><div className="editor w-full max-w(560) mx-auto"> <div className="editor-document" role="textbox" aria-multiline="true" aria-label="Document" contentEditable="true"> <h2 className="editor-heading">A heading</h2> <p className="editor-paragraph"> A paragraph with <a className="editor-link" href="#content">a link</a>, <em>emphasis</em> and <code className="code">inline code</code>. </p> <h3 className="editor-subheading">A subheading</h3> <ul className="editor-list"> <li className="editor-item"> <p className="editor-paragraph">A list with bullets</p> </li> <li className="editor-item"> <p className="editor-paragraph">Its markers in the muted ink</p> </li> </ul> <ol className="editor-list editor-list-numbered"> <li className="editor-item"> <p className="editor-paragraph">A list with numbers</p> </li> <li className="editor-item"> <p className="editor-paragraph">On an ordered list</p> </li> </ol> <blockquote className="editor-quote"> <p className="editor-paragraph">A quotation, a step quieter.</p> </blockquote> <hr className="editor-rule" /> <p className="editor-paragraph">And a paragraph after a rule.</p> </div></div><div class="editor w-full max-w(560) mx-auto"> <div class="editor-document" role="textbox" aria-multiline="true" aria-label="Document" contenteditable="true"> <h2 class="editor-heading">A heading</h2> <p class="editor-paragraph"> A paragraph with <a class="editor-link" href="#content">a link</a>, <em>emphasis</em> and <code class="code">inline code</code>. </p> <h3 class="editor-subheading">A subheading</h3> <ul class="editor-list"> <li class="editor-item"> <p class="editor-paragraph">A list with bullets</p> </li> <li class="editor-item"> <p class="editor-paragraph">Its markers in the muted ink</p> </li> </ul> <ol class="editor-list editor-list-numbered"> <li class="editor-item"> <p class="editor-paragraph">A list with numbers</p> </li> <li class="editor-item"> <p class="editor-paragraph">On an ordered list</p> </li> </ol> <blockquote class="editor-quote"> <p class="editor-paragraph">A quotation, a step quieter.</p> </blockquote> <hr class="editor-rule"> <p class="editor-paragraph">And a paragraph after a rule.</p> </div></div><template> <div class="editor w-full max-w(560) mx-auto"> <div class="editor-document" role="textbox" aria-multiline="true" aria-label="Document" contenteditable="true"> <h2 class="editor-heading">A heading</h2> <p class="editor-paragraph"> A paragraph with <a class="editor-link" href="#content">a link</a>, <em>emphasis</em> and <code class="code">inline code</code>. </p> <h3 class="editor-subheading">A subheading</h3> <ul class="editor-list"> <li class="editor-item"> <p class="editor-paragraph">A list with bullets</p> </li> <li class="editor-item"> <p class="editor-paragraph">Its markers in the muted ink</p> </li> </ul> <ol class="editor-list editor-list-numbered"> <li class="editor-item"> <p class="editor-paragraph">A list with numbers</p> </li> <li class="editor-item"> <p class="editor-paragraph">On an ordered list</p> </li> </ol> <blockquote class="editor-quote"> <p class="editor-paragraph">A quotation, a step quieter.</p> </blockquote> <hr class="editor-rule"> <p class="editor-paragraph">And a paragraph after a rule.</p> </div> </div></template>#States
Each state is an attribute the engine keeps on its element, or one the page sets on the frame: focus and aria-invalid="true" raise the frame or give it the danger edge, aria-readonly="true" lays it flat with no caret, and aria-disabled="true" on the frame drops it to a flat well with disabled ink. An invalid document shows the field's field-error. Disable the toolbar's controls with the editor, and tell the engine it is not editable.
States
<div class="grid gap-lg w-full max-w(560) mx-auto"> <div class="field"> <span id="state-invalid">Summary</span> <div class="editor" style="--editor-rows: 2"> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-invalid" aria-describedby="state-invalid-error" aria-invalid="true" contenteditable="true"></div> </div> <p class="field-error" id="state-invalid-error"> Write at least a sentence before you publish. </p> </div> <div class="field"> <span id="state-readonly">Published notes</span> <div class="editor" style="--editor-rows: 2"> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-readonly" aria-readonly="true" contenteditable="false" tabindex="0"> <p class="editor-paragraph"> Version 0.3 shipped tags, editable values and sortable lists. </p> </div> </div> </div> <div class="field"> <span id="state-disabled">Draft</span> <div class="editor" style="--editor-rows: 2" aria-disabled="true"> <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="false" disabled> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M4.6667 3H8.3333C12.3333 3 12.3333 7.6667 8.3333 7.6667H4.6667M4.6667 3V13H9C13.3333 13 13.3333 7.6667 9 7.6667" /> </svg> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false" disabled> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M6.6667 3L12.6667 3" /><path d="M3.3333 13L9.3333 13" /><path d="M9.6667 3L6.3333 13" stroke-linecap="butt" /> </svg> </button> <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false" disabled> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="3" cy="4" r="0.5" fill="currentColor" stroke="none" /><path d="M6 4L13.5 4" /><circle cx="3" cy="8" r="0.5" fill="currentColor" stroke="none" /><path d="M6 8L13.5 8" /><circle cx="3" cy="12" r="0.5" fill="currentColor" stroke="none" /><path d="M6 12L13.5 12" /> </svg> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false" disabled> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M9 4.3333L10 3.3333C11.0125 2.3208 12.6541 2.3208 13.6667 3.3333C14.6792 4.3459 14.6792 5.9875 13.6667 7L11.6667 9C10.6541 10.0125 9.0125 10.0125 8 9" /><path d="M9 4.3333L10 3.3333C11.0125 2.3208 12.6541 2.3208 13.6667 3.3333C14.6792 4.3459 14.6792 5.9875 13.6667 7L11.6667 9C10.6541 10.0125 9.0125 10.0125 8 9" transform="rotate(180 8 8)" /> </svg> </button> </div> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-disabled" aria-disabled="true" contenteditable="false"> <p class="editor-paragraph">Locked while the release is reviewed.</p> </div> </div> </div></div>import BoldIcon from '@master/icons-react/native/16/soft/bold'import ItalicIcon from '@master/icons-react/native/16/soft/italic'import ListIcon from '@master/icons-react/native/16/soft/list'import LinkIcon from '@master/icons-react/native/16/soft/link'<div className="grid gap-lg w-full max-w(560) mx-auto"> <div className="field"> <span id="state-invalid">Summary</span> <div className="editor" style={{ '--editor-rows': '2' } as React.CSSProperties}> <div className="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-invalid" aria-describedby="state-invalid-error" aria-invalid="true" contentEditable="true"></div> </div> <p className="field-error" id="state-invalid-error"> Write at least a sentence before you publish. </p> </div> <div className="field"> <span id="state-readonly">Published notes</span> <div className="editor" style={{ '--editor-rows': '2' } as React.CSSProperties}> <div className="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-readonly" aria-readonly="true" contentEditable="false" tabIndex={0}> <p className="editor-paragraph"> Version 0.3 shipped tags, editable values and sortable lists. </p> </div> </div> </div> <div className="field"> <span id="state-disabled">Draft</span> <div className="editor" style={{ '--editor-rows': '2' } as React.CSSProperties} aria-disabled="true"> <div className="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="false" disabled> <BoldIcon className="icon" /> </button> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false" disabled> <ItalicIcon className="icon" /> </button> <span className="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false" disabled> <ListIcon className="icon" /> </button> <button type="button" className="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false" disabled> <LinkIcon className="icon" /> </button> </div> <div className="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-disabled" aria-disabled="true" contentEditable="false"> <p className="editor-paragraph">Locked while the release is reviewed.</p> </div> </div> </div></div><script> import BoldIcon from '@master/icons-svelte/native/16/soft/bold' import ItalicIcon from '@master/icons-svelte/native/16/soft/italic' import ListIcon from '@master/icons-svelte/native/16/soft/list' import LinkIcon from '@master/icons-svelte/native/16/soft/link'</script><div class="grid gap-lg w-full max-w(560) mx-auto"> <div class="field"> <span id="state-invalid">Summary</span> <div class="editor" style="--editor-rows: 2"> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-invalid" aria-describedby="state-invalid-error" aria-invalid="true" contenteditable="true"></div> </div> <p class="field-error" id="state-invalid-error"> Write at least a sentence before you publish. </p> </div> <div class="field"> <span id="state-readonly">Published notes</span> <div class="editor" style="--editor-rows: 2"> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-readonly" aria-readonly="true" contenteditable="false" tabindex="0"> <p class="editor-paragraph"> Version 0.3 shipped tags, editable values and sortable lists. </p> </div> </div> </div> <div class="field"> <span id="state-disabled">Draft</span> <div class="editor" style="--editor-rows: 2" aria-disabled="true"> <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="false" disabled> <BoldIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false" disabled> <ItalicIcon class="icon" /> </button> <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false" disabled> <ListIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false" disabled> <LinkIcon class="icon" /> </button> </div> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-disabled" aria-disabled="true" contenteditable="false"> <p class="editor-paragraph">Locked while the release is reviewed.</p> </div> </div> </div></div><script setup>import BoldIcon from '@master/icons-vue/native/16/soft/bold'import ItalicIcon from '@master/icons-vue/native/16/soft/italic'import ListIcon from '@master/icons-vue/native/16/soft/list'import LinkIcon from '@master/icons-vue/native/16/soft/link'</script><template> <div class="grid gap-lg w-full max-w(560) mx-auto"> <div class="field"> <span id="state-invalid">Summary</span> <div class="editor" style="--editor-rows: 2"> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-invalid" aria-describedby="state-invalid-error" aria-invalid="true" contenteditable="true"></div> </div> <p class="field-error" id="state-invalid-error"> Write at least a sentence before you publish. </p> </div> <div class="field"> <span id="state-readonly">Published notes</span> <div class="editor" style="--editor-rows: 2"> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-readonly" aria-readonly="true" contenteditable="false" tabindex="0"> <p class="editor-paragraph"> Version 0.3 shipped tags, editable values and sortable lists. </p> </div> </div> </div> <div class="field"> <span id="state-disabled">Draft</span> <div class="editor" style="--editor-rows: 2" aria-disabled="true"> <div class="toolbar editor-toolbar" role="toolbar" aria-label="Formatting"> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bold" aria-pressed="false" disabled> <BoldIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Italic" aria-pressed="false" disabled> <ItalicIcon class="icon" /> </button> <span class="toolbar-separator" role="separator" aria-orientation="vertical"></span> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Bulleted list" aria-pressed="false" disabled> <ListIcon class="icon" /> </button> <button type="button" class="btn btn-quiet btn-sm btn-square" aria-label="Link" aria-pressed="false" disabled> <LinkIcon class="icon" /> </button> </div> <div class="editor-document" role="textbox" aria-multiline="true" aria-labelledby="state-disabled" aria-disabled="true" contenteditable="false"> <p class="editor-paragraph">Locked while the release is reviewed.</p> </div> </div> </div> </div></template>#Accessibility
- The document is a
role="textbox"witharia-multiline="true", named by the field's label witharia-labelledbyand described by its hint and error witharia-describedby. A<label for>cannot name an element that is not a form control. - The toolbar is one tab stop, named, with
aria-controlspointing at the document. Name every icon button, mark a toggle witharia-pressed, and givearia-keyshortcutsthe shortcut the engine handles. - After a toolbar command, focus goes back to the document, where the reader was writing.
- Do not add key handlers of your own to the document: an input method composing a word uses Enter and the arrows, and the engine knows when it does.
- In forced colors the frame is outlined in the field's color, in the highlight while it has focus.
#Classes
| Class | Description |
|---|---|
editor | The frame: the well of a field that holds the toolbar band and the document, and rises with the document's focus |
editor-toolbar | On a toolbar at the top of the frame: laid flat, one inset in, with a hairline under it; it wraps on a narrow editor |
editor-document | The element the engine makes editable: it grows from --editor-rows lines to --editor-max-rows, then scrolls. Name it with aria-labelledby, and describe it with the field's hint |
editor-paragraph | A paragraph of the document |
editor-heading | A heading of the document, on an h2 or the level the engine writes |
editor-subheading | A heading a level below editor-heading |
editor-list | A list with bullets, its markers in the muted ink; a list inside an item takes circles |
editor-list-numbered | Numbers instead of bullets, on an olApply with editor-list |
editor-item | An item of a list |
editor-quote | A quotation, on a blockquote: a rule at its start and its words a step quieter |
editor-link | A link in the document, underlined in the line's ink |
editor-rule | A horizontal rule between parts of the document |
#Custom properties
| Property | Default | Description |
|---|---|---|
--editor-rows | 6 | How many lines the document shows when it is empty |
--editor-max-rows | 18 | How many lines it grows to before it scrolls |
#Related
- InputText fields cut into the surface, with labels, hints, errors and groups.
- ToolbarA small raised sheet that holds a row of quiet controls.
- ComposerWhere a message or a prompt is written: a growing field over a row of tools.
- CodeLiteral text in the mono face, inline or as a block.