Shiki Highlighting

Syntax highlighting for the code editor, tokenized with shiki using the same themes as the documentation code panels.

UIcode-editor-shikiView JSON

Highlighting follows the class based theme of the page: github-light by default, github-dark when the dark class is present on the document, like the rest of shadcn/ui. The document is tokenized in the background, once the view is idle.

Preview

Installation

Add the item with the shadcn CLI, or copy the source manually.

pnpm dlx shadcn@latest add litingyes/blocove/code-editor-shiki

Requires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.

Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/code-editor-shiki

This example also uses: code-editor

pnpm dlx shadcn@latest add litingyes/blocove/code-editor

API Reference

Props accepted by the exported components.

CodeEditorShiki

Declares the shiki highlighting extension. The item ships its own highlighter, so the editor colors match the documentation code panels.

PropTypeDefault
languagestringroot language
colorScheme'auto' | 'light' | 'dark''auto'
delaynumber120
maxLengthnumber150000