Skip to main content
Version: Next

Web Component Integration

Web component integration guide for framework-agnostic editor deployment and runtime configuration.

When to use it

  • You need one editor API across multiple frameworks.
  • You want integration without a framework wrapper.
  • You need multiple independent editor instances on the same page.

Core attributes

  • plugins: space-separated plugin ids to load.
  • toolbar-items: command layout string with | separators.
  • theme: visual mode (light, dark, custom token scope).
  • statusbar: enable/disable status bar.
  • placeholder: empty-editor hint text.
  • height: fixed or controlled editor height.

Event and lifecycle model

  • Initialize via attributes and optional initial content.
  • Listen for content changes from editor events/callback hooks.
  • Destroy cleanly by removing the element; plugin listeners should detach with the instance.

Multi-instance behavior

  • Keep each editor id unique.
  • Scope sidebars/dialog containers to the active editor host.
  • Ensure command execution targets only the focused instance.

API Surface

SurfaceTypeNotes
<editora-editor>Custom element APICore framework-agnostic integration surface
Attributes (plugins, toolbar-items, theme, statusbar, placeholder, height)Declarative APIInitial per-instance behavior and visual setup
Runtime methods (setConfig, content/command methods where exposed)Imperative APIRuntime reconfiguration and programmatic control
Change/focus/selection eventsEvent APIHost integration for state sync and UI coordination
Instance-scoped plugin command wiringRuntime APIEnsures commands and overlays stay local to active instance

Config Matrix

ConcernConfig SurfaceRecommended Default
Themetheme + token CSS scopelight (switchable)
Toolbar densitytoolbar-itemsgrouped by workflow
Status metricsstatusbarenabled
Placeholder UXplaceholderexplicit per context
Instance isolationhost scoping + unique idrequired

Validation Checklist

  • Multiple visible editors do not leak commands or panel state.
  • Dialog positions resolve against the correct editor container.
  • Readonly and editable modes behave consistently.
  • Theme styles apply to content, toolbar, dialogs, and side panels.