Skip to main content
You pass options as the second argument to the Editor constructor. Every option is optional — you only need to provide the ones that differ from the defaults. The first argument is a CSS selector string (or a DOM element reference) identifying the container element where Lumen Editor will mount.

Options reference

string
Ghost text displayed inside the editor when its content is empty. Accepts any plain string. Defaults to an empty string (no placeholder shown).
"light" | "dark"
Visual theme applied to the editor UI. Set to 'dark' to activate the built-in dark colour scheme. Defaults to 'light'.
string | object
Controls the language used for toolbar tooltips and ARIA labels. Pass 'en' or 'tr' to use a built-in locale, or supply a custom locale object to provide your own strings. Defaults to 'en'.
string
Initial HTML content loaded into the editor on mount. The string is passed through the sanitizer before rendering. Defaults to an empty string.
string[][]
Defines which command buttons appear in the toolbar and how they are grouped. Each inner array is a group of command names separated by a visual divider. Omit a group or command name to hide those controls entirely.
See the Modules reference for the full list of built-in command names.
{ key: string, debounce: number }
Enables automatic persistence of editor content to localStorage. key is the storage key under which the HTML is saved. debounce is the delay in milliseconds after the last keystroke before the save fires. When present, the stored value is restored on next mount (taking precedence over value).
async (file: File) => string
An async function called when the user selects an image through the image toolbar button. Receive the raw File object, upload it however you like, and return the public URL string that will be inserted into the editor as the src of an <img> tag.
Combine uploadImage with maxImageSize and allowedImageTypes to validate files before they are uploaded.
((editor: Editor) => void)[]
An array of plugin functions, each of which receives the Editor instance and can extend or modify its behaviour. Plugins are called once, in order, immediately after the editor has mounted.
EditorModule[]
The full set of toolbar module definitions available to the editor. Defaults to the complete built-in modules set. Pass a merged array to add custom modules alongside the defaults, or a completely custom array to replace the built-in set entirely.
See the Modules reference for the module object shape and a list of all built-in modules.
object
A configuration object that overrides the default HTML sanitizer allowlist. When provided, it entirely replaces the defaults — any key you omit falls back to an empty/disabled state rather than inheriting the default. Supply all required keys explicitly.
See the Sanitizer reference for a full breakdown of each key and a hardening example.
number
Maximum permitted file size (in bytes) for images inserted via the toolbar image button. Files that exceed this limit are rejected before uploadImage is called. Defaults to 5242880 (5 MB).
string[]
An allowlist of MIME types for images inserted via the toolbar. Files whose type is not in this list are rejected before uploadImage is called. Defaults to ['image/png', 'image/jpeg', 'image/gif', 'image/webp'].

Full example

The snippet below shows all options used together for reference. In practice, only include the options you need to override.

Sanitizer

Customise the HTML allowlist to control which tags, attributes, and CSS properties survive sanitisation.

Modules

Explore all 17 built-in toolbar modules and learn how to define your own.

Custom Toolbar

Step-by-step guide to building and registering a custom toolbar module.