@sylang/code-editor
v0.1.0
Published
CodeMirror 6 editor as a plain React component — drop-in for any host that wants language-aware code editing without rolling their own CM6 setup.
Downloads
85
Readme
@sylang/code-editor
CodeMirror 6 editor as a plain React component — drop-in for any host that wants language-aware code editing without rolling their own CM6 setup.
Install
pnpm add @sylang/code-editorUsage
import { CodeMirrorEditor } from '@sylang/code-editor'
<CodeMirrorEditor
value={text}
language=".ts" // file extension drives the language extension
onChange={setText}
/>Supports JS/TS, JSON, YAML, Markdown, Python, and most languages CodeMirror ships with. Includes a dark theme out of the box.
Part of @sylang-core.
Apache-2.0.
