Skip to main content
Version: Next

Web Component Example

Practical setup patterns for <editora-editor> with plugin loading, toolbar composition, theming, and multi-instance layout.

Minimal setup

<editora-editor
id="editor-a"
theme="light"
plugins="bold italic underline link table history"
toolbar-items="undo redo | bold italic underline | link table"
placeholder="Start writing..."
statusbar="true"
></editora-editor>

Multi-instance setup

  • Give every editor a unique id.
  • Keep plugin sets and toolbar layouts context-specific.
  • Use per-instance theme attributes/classes when mixing light and dark editors.

Runtime checks

  • Verify command routing stays local to focused editor.
  • Verify sidebars/dialogs mount under the clicked editor container.
  • Verify status bar metrics update only for active instance.

API Surface

SurfaceTypeNotes
<editora-editor plugins=\"...\">Attribute APIDeclares plugin set for the instance
toolbar-items=\"...\"Attribute APIDeclares command layout and grouping
theme, statusbar, placeholder, heightAttribute APIControls visual/UX behavior per instance
setConfig({...})Runtime methodUpdates toolbar/autosave/security/performance/accessibility without remount
change and focus/selection eventsEvent APISync content/state with host application logic
execCommand(...) (when exposed by runtime)Command APIExecutes instance-scoped commands from external controls

Config Matrix

Use CaseSuggested Config
Minimal editorsmall plugin set + compact toolbar
Document editorfull plugin set + statusbar + autosave
Multi-editor pageunique ids + scoped panels + mixed themes

Validation Checklist

  • Initial content renders without cursor-jump regressions.
  • Selection commands and dialogs remain stable after focus changes.
  • Readonly mode preserves interactive restrictions correctly.