Skip to main content

Editor42 in a Svelte app

When to use

When you are building with Svelte 5 and want the editor as a component, with its content bindable like any other prop.

How it works

The component from @editor42/editor42-svelte. In a .svelte file you write <Editor bind:value={content}/>; a demo page has no component file to compile, so the same component is mounted from JavaScript with Svelte's own mount() and reports changes through its change and keyup props. Editor options go in conf.

How to start using

Install the component with npm install @editor42/editor42-svelte and bind it with bind:value. Svelte 5 is required — the component is written with runes.

See the Svelte install page for self-hosting and the move from @tinymce/tinymce-svelte.