Skip to main content
Version: Next

Vanilla HTML Examples

Vanilla HTML and web component examples for framework-free Editora integration.

When to choose this path

  • You want no framework dependency
  • You need embeddable editor widgets
  • You want simple CDN-based adoption
  • You need quick QA harness pages

Core bundle vs full bundle

Core bundle

  • Smaller payload
  • Good for basic formatting and editing

Full bundle

  • Broader plugin and toolbar coverage
  • Better for advanced authoring workflows

Quick start (CDN)

<script type="module" src="https://cdn.jsdelivr.net/npm/@editora/core/dist/webcomponent.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@editora/core/dist/webcomponent.min.css" />

<editora-editor
plugins="bold italic underline history"
toolbar-items="bold italic underline | undo redo"
height="320"
></editora-editor>

Runtime config example

<editora-editor id="editor" theme="dark"></editora-editor>
<script>
const editor = document.getElementById("editor");
editor.setConfig({
autosave: { enabled: true, intervalMs: 5000, storageKey: "doc-1" },
security: { sanitizeOnPaste: true, sanitizeOnInput: true },
performance: { debounceInputMs: 100, viewportOnlyScan: true },
accessibility: { enableARIA: true, keyboardNavigation: true, checker: false },
});
</script>

Validation checklist

  • Toolbar commands operate on focused editor
  • Theme styles apply to dialogs and sidebars
  • Placeholder/content behavior is correct on empty/non-empty states
  • Readonly mode blocks mutations

API Surface

SurfaceTypeNotes
<editora-editor>Custom element APIMain integration surface for framework-free usage
plugins, toolbar-items, theme, height, statusbarAttribute configInitial declarative setup
autosave, security, performance, accessibilityAttribute/object configOperational controls at startup
setConfig(config)Runtime methodApplies configuration changes after mount
change/focus/blur/selection eventsEvent APIHost integration points for sync and telemetry

Config Matrix

Config PathPurpose
AttributesInitial setup (plugins, toolbar, theme)
setConfig(...)Runtime updates (autosave/security/performance/accessibility)
CSS importsTheme and visual behavior

Validation Checklist

  • Initial attribute config renders expected UI/features
  • Runtime updates apply without remount issues
  • Multi-instance pages keep config/state isolated
  • Browser support matches target deployment matrix