UI Library

LazyCodeEditor

Loading editor...
Prop Type Default Value Notes
autoFocusbooleanfalse
Focuses the editor once it mounts.
containerClassstring?''
Classes for the outer wrapper; give it a bounded height.
contentstring—
Bindable editor document. The eye resets to the default content.
docTypestring'text'
Language pack key: json, javascript, html, markdown, yaml, or xml (loaded on demand). 'text' loads none.
editablebooleantrue
Enables typing; false renders read-only.
editorClassstring?''
Classes for the CodeMirror host; use h-full inside a sized wrapper.
maxContentLengthnumber?0
Caps the document length; 0 disables the cap.
editorAriaLabelstring?editor.content
Accessible name for the editor textbox; unset, the localized editor.content key renders.
recreateKeystring?''
Changing it destroys and rebuilds the editor.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number'md'
Editor text scale; numbers are icon-scale pixels. The font, content padding, and loading text follow it.
onAutoFocused() => void——Called after an autofocus.
onContentChange(content: string) => void——Called with the document after every edit.
onReady() => void——Called once the EditorView exists.