Skip to content

@sqlrooms/codemirror / CodeMirrorEditorProps

Interface: CodeMirrorEditorProps

Properties

className?

optional className?: string

CSS class name for the editor container


value?

optional value?: string

The content to display in the editor


readOnly?

optional readOnly?: boolean

Whether the editor should be in read-only mode


onChange?

optional onChange?: (value) => void

Callback when the editor content changes

Parameters

ParameterType
valuestring

Returns

void


onMount?

optional onMount?: (view) => void

Callback when the editor view is mounted - provides access to EditorView instance

Parameters

ParameterType
viewEditorView

Returns

void


onValidate?

optional onValidate?: (diagnostics) => void

Callback when lint diagnostics change (validation errors/warnings)

Parameters

ParameterType
diagnosticsDiagnostic[]

Returns

void


extensions?

optional extensions?: Extension[]

Additional CodeMirror extensions to apply


options?

optional options?: CodeMirrorEditorOptions

Additional configuration options