Primitives
Code Diff
Unified or split diff from a git patch or a before/after pair, with word-level intra-line highlighting.
Examples
Headerless copy
Use the same copy affordance when a diff does not need its filename and stats row.
Composition
The preferred shape for composing the installed primitive from its exported parts.
Parts
Exported compound parts from the installed source.
CodeDiff└── CodeDiffCopyThe refined source installs this primitive from src/registry/sources/refined/ui/code-diff.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-diff.jsonInstalled dependencies
Installed with this primitive because the slot depends on them; they are support files, not standalone sidebar items.
Code slot
src/registry/sources/refined/ui/code.tsxSupportButton slot
src/registry/sources/refined/ui/button.tsxSkinTooltip slot
src/registry/sources/refined/ui/tooltip.tsxSkinDiff engine
src/registry/lib/diff.tsSupportShiki tokenizer
src/registry/lib/code-tokens.tsSupportCode + diff tokens
src/registry/sources/refined/code.cssSupportRaw code
Primary installed primitive source
Code diff slot
src/registry/sources/refined/ui/code-diff.tsx