Skip to main content
This guide walks you through everything you need to go from a blank project to a fully functional rich text editor. By the end you will have Lumen Editor installed, mounted on a page, configured with real options, and wired up to read content and respond to changes.

Prerequisites

Before you begin, make sure you have the following in place:
  • A modern browser (Chrome 90+, Firefox 88+, Safari 14+, or Edge 90+) for the runtime environment.
  • Node.js 16+ and npm (or yarn / pnpm) if you plan to install via a package manager. You can skip this requirement entirely if you prefer the CDN approach.
No build step is required. If you just want to try Lumen Editor immediately, load it straight from a <script type="module"> tag pointing at the CDN bundle — no Node.js needed. See the Installation page for the full CDN snippet.

Steps

1

Install Lumen Editor

Add the package to your project using your preferred package manager.
Then import the editor class and its stylesheet at the top of your entry file. The stylesheet import is required — it provides the toolbar styles and theme variables.
2

Add an HTML container

Lumen Editor mounts into any existing element on your page. Add a <div> (or any block element) with an id that you will pass to the constructor. Give it a minimum height so it is visible before the user starts typing.
3

Initialize the editor with options

Create a new Editor instance, passing your container selector as the first argument and an options object as the second. The example below demonstrates the full set of supported options so you can pick the ones relevant to your use case.
Every option is optional. Calling new Editor('#editor', {}) is perfectly valid and gives you a working editor with sensible defaults.
4

Listen for changes and read content

Subscribe to the change event to react whenever the user edits the document. Use getHTML() to retrieve sanitized HTML or getText() for plain text.
You can also listen for other built-in events:

What’s Next?

You now have a working Lumen Editor instance. From here you can:
  • Explore all install methods (yarn, pnpm, CDN) on the Installation page.
  • Learn how to extend the editor with the plugin system by writing a simple (editor) => { ... } function.
  • Tighten security or customise the sanitizer allowlist for your content requirements.