Markdown Editor

A Markdown editor with a formatting toolbar and a preview, plus Markdown Content to show what was written.
Stable
Web
iOS
Android
@advui/editor
Source

In a form field, with a limit

232 of 1000 characters
Markdown is supported. Use Preview to check it.

Installation

pnpm
pnpm add @advui/editor
npm
npm install @advui/editor

Usage

import { MarkdownContent, MarkdownEditor } from '@advui/editor'

<MarkdownEditor aria-label="Report" value={markdown} onValueChange={setMarkdown} />

// Show saved text:
<MarkdownContent>{markdown}</MarkdownContent>

Examples

Fewer tools, for comments

Showing saved text

Distribution plan
Register households with the village tract leader
Hand out hygiene kits at the monastery
Record every distribution in the 5W form
Keep paper lists digital records only.

API reference

MarkdownEditor

PropTypeDefaultDescription
valuestring—The text, as Markdown.
defaultValuestring—Starting `value` when uncontrolled.
onValueChange(value: string) => void—Called with the new `value`.
placeholderstring—Shown while empty.
toolsMarkdownTool[]all nineToolbar buttons, in order: 'bold', 'italic', 'strikethrough', 'heading', 'bulletList', 'orderedList', 'quote', 'link', 'code'.
minHeightnumber | SizeTokens'32'Height of the text area before it grows.
maxLengthnumber—Limit, with a character count read as the field’s description.
invalidboolean—Error styling and `aria-invalid`.
disabledboolean—Not focusable or editable.
aria-labelstring—Names the editor when there is no visible label. A Field sets it for you.
idstring—Links the text area to a Label’s `htmlFor`. A Field sets it for you.
aria-describedbystring—Ids of help or error text. A Field sets it for you.
labelsPartial<MarkdownEditorLabels>—Toolbar, tool, preview and count text, for translation.

MarkdownContent

Shows Markdown with the same styles. Also takes View props.
PropTypeDefaultDescription
children requiredstring—The Markdown.
headingOffsetnumber1Added to heading levels, so `#` is an h2 under the page’s h1.

Accessibility

  • The text area is a normal multi-line field, named by aria-label or a Field.
  • The toolbar is a WAI-ARIA toolbar with one tab stop; each tool is a named button (with its shortcut in the tooltip).
  • After a tool is used, focus returns to the text with the new text selected, so you can keep typing.
  • Preview is a toggle button (aria-pressed); the preview is a named region with real headings and lists.
  • Links in Markdown Content only follow http(s) and mailto addresses and open in a new tab on web.
Keyboard interactions
KeyAction
⌘ / Ctrl + BBold.
⌘ / Ctrl + IItalic.
⌘ / Ctrl + KLink.
TabToolbar, Preview, then the text.
Arrow keysMove between tools in the toolbar.

Responsive behavior

The toolbar wraps on narrow screens.

Platform notes

Web
The value is Markdown, not HTML, so saved text cannot carry scripts. Tools keep the text selected.
iOS
The same editor on a native text field; tools act on the selection.
Android
Same as iOS.
Since v0.6.0Last updated Nov 2, 2026Edit this page on GitHub