Skip to main content
Version: 1.0.0

Web Component Integration

@editora/core ships a native custom element (<editora-editor>) for framework-agnostic usage.

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

  • Custom element API: attributes + methods + events.
  • Runtime configuration update support via element props/attributes.
  • Plugin command wiring resolved per editor 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.