Code Block
A muted code surface with line numbers, focused rows, filename metadata, and copy feedback.
Loading component preview…
Installation
Add the component source directly to your project.
pnpm dlx shadcn@latest add https://pastaui.com/r/code-block.jsonAPI reference
Code Block
| Prop | Type | Default | Description |
|---|---|---|---|
code | string | — | Provides the displayed source. |
highlightLines | number[] | [] | Emphasizes selected line numbers. |
showLineNumbers | boolean | true | Toggles the number gutter. |