Skip to content
OTF Kit logoOTF Kit

Rich Editor

Input

Tiptap-based WYSIWYG editor with full toolbar, bubble menu, slash commands, tables, and markdown shortcuts.

View in Storybook
Rich Editor
Loading Storybook preview…

Installation

bun add @otfdashkit/ui

Usage

Import RichEditor from @otfdashkit/ui.

Code
// Rich Editor — Tiptap-based WYSIWYG editor with full toolbar, bubble menu, slash commands, tables, and markdown shortcuts.
//
// Install:
//   bun add @otfdashkit/ui

import { RichEditor } from '@otfdashkit/ui'

export function Example() {
  return (
    <RichEditor>
      {/* your content */}
    </RichEditor>
  )
}

Props

Props declared in the RichEditor source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
defaultValuestring | (readonly string[] & string)Initial uncontrolled HTML content.
editablebooleantrueDefault true. When false the toolbar is visually disabled and content read-only.
maxLengthnumberOptional character cap. Shows a counter and clamps content via onUpdate.
onChange(html: string) => voidFired (debounced 100ms) when the editor's HTML changes.
placeholderstring'Write something...'Placeholder shown when the document is empty.
toolbar'full' | 'minimal' | 'bubble''full'Toolbar layout. Default 'full'.
valuestringControlled HTML content.

Related