Primitives
Code
Shared code surface: Shiki-highlighted lines, gutter, clean copy, and virtualization for large files.
Examples
Headerless copy
Use an icon copy action when the filename row would add noise.
Composition
The preferred shape for composing the installed primitive from its exported parts.
Parts
Exported compound parts from the installed source.
Code├── CodeHeader├── CodeTitle├── CodeActions├── CodeCopy├── CodeFloatingCopy├── CodeTokenLine└── CodeContentThe refined source installs this primitive from src/registry/sources/refined/ui/code.tsx. Install it on its own with the command above, or inspect the source below.
npx shadcn@latest add http://127.0.0.1:3000/r/refined/code.jsonInstalled dependencies
Installed with this primitive because the slot depends on them; they are support files, not standalone sidebar items.
Button slot
src/registry/sources/refined/ui/button.tsxSkinTooltip slot
src/registry/sources/refined/ui/tooltip.tsxSkinShiki tokenizer
src/registry/lib/code-tokens.tsSupportCode + diff tokens
src/registry/sources/refined/code.cssSupportRaw code
Primary installed primitive source
Code slot
src/registry/sources/refined/ui/code.tsx