CodeBlock
Syntax-highlighted codeblock component built on top of react-syntax-highlighter.
Loading...
Installation
npx shadcn@latest add @scrollxui/codeblock Usage
import { CodeBlock } from "@/components/ui/codeblock";<CodeBlock
language="typescript"
filename="main.tsx"
tabs={[
{ name: 'api.ts', code: "fetchData()" },
{ name: 'styles.css', code: ".card { padding: 1rem }", language: 'css' }
]}
breadcrumb={['src', 'components']}
/>Examples
CodeBlock with Light theme
Loading...
CodeBlock with Multitabs
Loading...
API Reference
CodeBlock
Syntax-highlighted code block with tabs, stats, and file navigation.