Simple Editor
A lightweight rich text editor with essential formatting options. Perfect for basic content editing needs with a clean and intuitive interface.
Installation
Install via CLI
npx @moontra/moonui-cli add simple-editorUsage
Examples
Basic Usage
The default editor with its full toolbar — rich text in, HTML string out via onChange
Without Toolbar
Hiding the toolbar leaves a plain contenteditable surface, useful for comment boxes where formatting should stay minimal
Disabled State
A read-only editor that still renders formatted content but blocks input and greys the toolbar
Custom Height
Fixing the height turns the editor into a scrolling region instead of letting it grow with the content
Form Integration
Wiring the editor into a form: the HTML value is held in state and submitted alongside the other fields
With Initial Content
Seeding the editor with existing HTML — the usual shape when editing a saved record rather than composing from scratch