Code Block
Display code with syntax highlighting powered by Shiki.
Loading...
import { CodeBlock } from "@/components/ui/code-block"
const code = `import { Button } from "@/components/ui/button"Installation
pnpmnpmyarnbun
Usage
import { CodeBlock } from "@/components/ui/code-block"<CodeBlock code={`console.log("Hello, World!")`} language="javascript" />Examples
With Line Numbers
Enable line numbers with the showLineNumbers prop.
Loading...
import { CodeBlock } from "@/components/ui/code-block"
const code = `function fibonacci(n: number): number {Simple Command
Display a simple command or snippet.
Loading...
import { CodeBlock } from "@/components/ui/code-block"
const code = `npm install nessra-ui`API Reference
CodeBlock
CodeBlock uses Shiki for syntax highlighting and automatically adapts to light/dark mode.