Skip to content
Cynco UI

AI

CodeBlock

Syntax-highlighted code (Shiki, one-light / one-dark-pro) with line numbers and a copy button.

import { CodeBlock } from "@cynco-labs/ui/ai";

Example

Use

Code in assistant replies and tool output.

Props

code, language, showLineNumbers; CodeBlockCopyButton child.

Notes

The bundle carries Shiki grammars for TypeScript, TSX, JavaScript, JSX, JSON, Bash, Python, CSS, HTML, Markdown, YAML, SQL and Go; other languages render as plain text.

Source Demo source Markdown