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
Ghost text displayed inside the editor when its content is empty. Accepts any plain string. Defaults to an empty string (no placeholder shown).
Visual theme applied to the editor UI. Set to
'dark' to activate the built-in dark colour scheme. Defaults to 'light'.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'.Initial HTML content loaded into the editor on mount. The string is passed through the sanitizer before rendering. Defaults to an empty 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.
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).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.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.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.
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.
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).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.Related pages
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.