Skip to main content

Editor42 as a Web Component

When to use

When there is no framework to hang a component on — a server-rendered page, Astro, htmx, Solid, Qwik — or when you simply want the editor to be a tag.

How it works

The script registers <editor42-editor> as a custom element. Common options are attributes, the element's own text content is its starting value, and because it is form-associated, a name is all it takes to submit with the surrounding form — the demo reads it straight out of FormData.

How to start using

Install the element with npm install @editor42/editor42-webcomponent, load it once, and write <editor42-editor> anywhere markup goes — plain HTML, Astro, htmx, Solid or Qwik. It is form-associated, so a name is all it needs to submit.

See the Web Component install page for the attribute list and the move from @tinymce/tinymce-webcomponent.