Editor

Markdown-backed rich text surface with optional static and floating format toolbars.

Also known as: markdown editor, rich text, contenteditable

Installation

Install with the CLI, or copy the component source into your project.

Add editor (npm)

npx --yes -p @default-file/ui df-ui add editor

Default

Markdown-backed surface with a static format bar and a floating bar on selection. Edits serialize back to Markdown.

Release notes

Select text to format. Try bold, italic, and lists.

Checklist

  • Review copy
  • Confirm structure
  • Outline the change
  • Record the owner

Static toolbar

toolbar static pins a format bar above the surface and hides the selection toolbar.

Release notes

Select text to format. Try bold, italic, and lists.

Checklist

  • Review copy
  • Confirm structure
  • Outline the change
  • Record the owner

Floating toolbar

toolbar floating hides the pinned bar. Select text to open the selection toolbar.

Release notes

Select text to format. Try bold, italic, and lists.

Checklist

  • Review copy
  • Confirm structure
  • Outline the change
  • Record the owner

Read only

readOnly blocks edits and disables interactive toolbar controls.

Release notes

Select text to format. Try bold, italic, and lists.

Checklist

  • Review copy
  • Confirm structure
  • Outline the change
  • Record the owner

Placeholder

Empty-state hint when the document has no content.

Minimum height

minHeight sets --df-editor-min-height for this instance.

Release notes

Select text to format. Try bold, italic, and lists.

Checklist

  • Review copy
  • Confirm structure
  • Outline the change
  • Record the owner

No toolbar

toolbar none hides kit format chrome.

Release notes

Select text to format. Try bold, italic, and lists.

Checklist

  • Review copy
  • Confirm structure
  • Outline the change
  • Record the owner

Properties

Markdown-backed rich text surface with optional static and floating format toolbars.

Editor

PropTypeDefaultNotes
valuestring-Controlled Markdown document (required).
onChange(markdown: string) => void-Called with serialized Markdown after edits settle.
placeholderstring-Empty-state hint. Defaults to the kit string catalogue.
readOnlybooleanfalseBlocks edits and hides interactive toolbar controls.
minHeightstring-CSS length applied to --df-editor-min-height for this instance.
toolbar"static" | "floating" | "both" | "none""both"static pins a format bar above the surface. floating shows a selection toolbar. both enables both. none hides kit chrome.
autoFocusbooleanfalseFocus the editable surface on mount.
aria-labelstring-Accessible name for the editable surface. Defaults to the kit string catalogue. Override when the host already names the field with a visible Label.
classNamestring-Additional styles on the root.

Accessibility

Editable name: The contenteditable surface uses aria-label (catalogue default, or your override). Format toolbars use catalogue labels for icon-only controls. Prefer a visible Label with htmlFor only when you wrap a separate form control; this surface is not a native input.