RichTextEditor

molecules

Rich text editor for event descriptions. Replaces TinyMCE. TipTap/Lexical wrapper.

ARIA Role: textbox

Demo

Demo for RichTextEditor (molecules)

Rich text editor for event descriptions. Replaces TinyMCE. TipTap/Lexical wrapper.

Props

PropTypeRequiredDefaultDescription
valuestringNoEditor content (HTML)
onChange(html: string) => voidYesContent change handler
disabledbooleanNofalseDisabled state
placeholderstringNoPlaceholder text
toolbarToolbarOption[]NoToolbar options

TypeScript Interface

interface RichTextEditorProps {
  value?: string;
  onChange: (html: string) => void;
  disabled?: boolean;
  placeholder?: string;
  toolbar?: ToolbarOption[];
}

Assertions (NASA Rule 5)

  • [aria]Editable area must have role='textbox' and aria-multiline='true'(WAI-ARIA APG)
  • [aria]Toolbar buttons must have aria-label(WCAG 1.1.1)
  • [keyboard]Tab navigates toolbar, Ctrl+B/I/U keyboard shortcuts work(WCAG 2.1.1)
  • [validation]Output HTML must be sanitized (DOMPurify or equivalent)(OWASP XSS)

Usage

Import

import { Richtexteditor } from '@epasslive/design-system'

Basic

<Richtexteditor />

With Variants

<Richtexteditor variant="primary" size="md" />