Sortable data table
Compare structured records with sortable columns.
Present code with legible hierarchy and copy access.
npx shadcn@latest add @silicon-ui/code-blocknpx shadcn@latest add @silicon-ui/code-blockInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/code-block/code-block.tsxcomponents/silicon-ui/code-block/code-block.module.csscomponents/silicon-ui/copy-button/copy-button.tsx sharedcomponents/silicon-ui/copy-button/copy-button.module.css sharedcomponents/silicon-ui/lib/use-copy-feedback.ts sharedInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
code*Source shown in the block and copied by the action. | string | — |
filenameFile name displayed in the header. | string | — |
languageUsed for the header label and lightweight syntax highlighting. | string | "tsx" |
maxLinesCollapse longer sources to this many lines, with a toggle that expands the rest in place. | number | — |