Vanilla JS
The core is one function, createEditor(options). Use it with any bundler, or from a CDN with one script tag.
On this page
Install
Usage
Good to know
- Load the stylesheet once, call
createEditor()in the browser after the element exists (it throws during server-side rendering), and calleditor.destroy()when the element goes away. - On a
<textarea>the editor hides the field and keeps its value in sync. The textarea's<label>becomes the editor's accessible name.
Always sanitize on the server
The editor sanitizes what it loads and produces, but that is not a security boundary: anyone can post any string to your API. Sanitize the HTML again with a library you trust before you store it or render it for other users.