Skip to content
Get Pro

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.json

API reference

Code Block

Code Block properties
PropTypeDefaultDescription
codestringProvides the displayed source.
highlightLinesnumber[][]Emphasizes selected line numbers.
showLineNumbersbooleantrueToggles the number gutter.