# Code Editor A complete code editor block: shiki highlighting, language support, line numbers, the toolbar and the status bar, with a controlled document. ## Installation ```bash npx shadcn@latest add litingyes/blocove/code-editor-block ``` The block installs a single file and depends on the editor shell, the shiki highlighting, the language item and the line numbers, so the CLI brings a working editor. Replace `defaultValue` with the code your app edits. ## Usage ### Use the block ```tsx import { CodeEditorBlock } from "@/components/blocove/code-editor-block" export function ReviewPanel() { return ( console.log(value)} /> ) } ``` ## API Reference ### CodeEditorBlock The editor with the shiki highlighting, the language item, the line numbers, the toolbar and the status bar already composed. | Prop | Type | Default | | --- | --- | --- | | `defaultValue` | `string` | `Built-in demo document` | | `language` | `string` | `"tsx"` | | `readOnly` | `boolean` | `false` | | `onChange` | `(value: string) => void` | - | | `className` | `string` | - | ## Registry dependencies - `litingyes/blocove/code-editor` - `litingyes/blocove/code-editor-shiki` - `litingyes/blocove/code-editor-languages` - `litingyes/blocove/code-editor-line-numbers` Namespace: `npx shadcn@latest add @blocove/code-editor-block`