MCPcopy Create free account
hub / github.com/uiwjs/react-codemirror / ReactCodeMirrorProps

Interface ReactCodeMirrorProps

core/src/index.tsx:16–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14export * from './utils';
15
16export interface ReactCodeMirrorProps
17 extends Omit<EditorStateConfig, 'doc' | 'extensions'>,
18 Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'placeholder'> {
19 /** value of the auto created model in the editor. */
20 value?: string;
21 height?: string;
22 minHeight?: string;
23 maxHeight?: string;
24 width?: string;
25 minWidth?: string;
26 maxWidth?: string;
27 /** focus on the editor. */
28 autoFocus?: boolean;
29 /** Enables a placeholder—a piece of example content to show when the editor is empty. */
30 placeholder?: string | HTMLElement;
31 /**
32 * `light` / `dark` / `Extension` Defaults to `light`.
33 * @default light
34 */
35 theme?: 'light' | 'dark' | 'none' | Extension;
36 /**
37 * Whether to optional basicSetup by default
38 * @default true
39 */
40 basicSetup?: boolean | BasicSetupOptions;
41 /**
42 * This disables editing of the editor content by the user.
43 * @default true
44 */
45 editable?: boolean;
46 /**
47 * This disables editing of the editor content by the user.
48 * @default false
49 */
50 readOnly?: boolean;
51 /**
52 * Controls whether pressing the `Tab` key inserts a tab character and indents the text (`true`)
53 * or behaves according to the browser's default behavior (`false`).
54 * @default true
55 */
56 indentWithTab?: boolean;
57 /** Fired whenever a change occurs to the document. */
58 onChange?(value: string, viewUpdate: ViewUpdate): void;
59 /** Some data on the statistics editor. */
60 onStatistics?(data: Statistics): void;
61 /** Fired whenever any state change occurs within the editor, including non-document changes like lint results. */
62 onUpdate?(viewUpdate: ViewUpdate): void;
63 /** The first time the editor executes the event. */
64 onCreateEditor?(view: EditorView, state: EditorState): void;
65 /**
66 * Extension values can be [provided](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions) when creating a state to attach various kinds of configuration and behavior information.
67 * They can either be built-in extension-providing objects,
68 * such as [state fields](https://codemirror.net/6/docs/ref/#state.StateField) or [facet providers](https://codemirror.net/6/docs/ref/#state.Facet.of),
69 * or objects with an extension in its `extension` property. Extensions can be nested in arrays arbitrarily deep—they will be flattened when processed.
70 */
71 extensions?: Extension[];
72 /**
73 * If the view is going to be mounted in a shadow root or document other than the one held by the global variable document (the default), you should pass it here.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…