features/codemirror/plugin
CodeMirror Plugin
Enables CodeMirror as a string input mode in Stately forms. This plugin provides syntax-highlighted code editing for string fields.
Usage
Peer Dependencies
You must install CodeMirror packages in your project:
For themes, install the theme packages you want:
Direct Component Access
For components that need CodeMirror directly (not through string field modes):
Interfaces
CodeMirrorExtras
Defined in: packages/stately/src/features/codemirror/plugin.tsx:110
Extras provided by the CodeMirror plugin.
Properties
ToggledEditor
ToggledEditor:
ComponentType<CodemirrorEditorToggleProps>
Defined in: packages/stately/src/features/codemirror/plugin.tsx:111
CodemirrorPluginOptions
Defined in: packages/stately/src/features/codemirror/plugin.tsx:80
Configuration options for the CodeMirror plugin.
Properties
codemirrorProps?
optionalcodemirrorProps:Partial<CodemirrorEditorBaseProps>
Defined in: packages/stately/src/features/codemirror/plugin.tsx:84
Override props for the CodeMirror editor component.
editorWrapperProps?
optionaleditorWrapperProps:EditorWrapperProps
Defined in: packages/stately/src/features/codemirror/plugin.tsx:89
Provide props for the editor wrapping component.
mode?
optionalmode:Partial<StringMode>
Defined in: packages/stately/src/features/codemirror/plugin.tsx:96
Customize or override how the mode appears in the string field dropdown.
Default
modeGroup?
optionalmodeGroup:string
Defined in: packages/stately/src/features/codemirror/plugin.tsx:104
Set a custom mode group for the editor. If any existing mode groups are provided, the editor will appear in that mode group's list.
Default
Variables
codemirror
constcodemirror:FeaturePlugin<CodemirrorPluginOptions,ReactCodeMirrorProps,CodeMirrorExtras>
Defined in: packages/stately/src/features/codemirror/plugin.tsx:143
CodeMirror feature plugin.
Provides syntax-highlighted code editing for string fields.
Examples
defaultCodemirrorStringMode
constdefaultCodemirrorStringMode:StringMode
Defined in: packages/stately/src/features/codemirror/plugin.tsx:70
Default string mode configuration