Code Editor
CodeMirror 6 editor with controlled state, lazy languages, diagnostics, search, folding, and token-aware themes.
Preview
This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.
Loading interactive preview…
Installation
pnpm dlx aq-ui@alpha add code-editorAPI reference
Client moduleView full sourceQuick start
"use client"
import { CodeEditor } from "@/components/ui/code-editor"
<CodeEditor />Exports
CodeDiagnostictypeCodeEditorconstCodeEditorHandletypeCodeEditorPropsinterfaceCodeEditorStatusBarfunctionCodeEditorStatusBarPropsinterfaceCodeLanguagetypeCodeLanguageLoadertypeloadCodeLanguagefunctionregisterCodeLanguagefunctionuseCodeEditorfunction
Registry dependencies
use-code-editor, utils
Package dependencies
@codemirror/state@^6.7.1
Files
- components/ui/code-editor.tsx