Design & UI
shadcn Component Adaptation
Use when adding a shadcn/ui component to a project with an opinionated design system, so the copied component matches the system rather than the shadcn defaults. Also use when an installed component brings radii, shadows, or colors that fight the design contract, when accessibility was lost while restyling, or when variants have drifted apart across components. If a component is copied in from a registry, use this skill.
1 file
Description
Use when adding a shadcn/ui component to a project with an opinionated design system, so the copied component matches the system rather than the shadcn defaults. Also use when an installed component brings radii, shadows, or colors that fight the design contract, when accessibility was lost while restyling, or when variants have drifted apart across components. If a component is copied in from a registry, use this skill.
name: shadcn-component-adaptation description: Use when adding a shadcn/ui component to a project that has an opinionated design system, so the copied component matches the system instead of the shadcn defaults. Covers install, adaptation, and consistency.
shadcn Component Adaptation
When to trigger
Adding a button, dialog, dropdown, or any shadcn/ui component to a codebase with an established visual contract (specific radius, palette, borders, no gradients).
Why adapt, not just install
shadcn copies component source into your repo. That is the feature: you own it and edit it. The defaults (rounded corners, a specific ring color, subtle gradients) are opinions that will clash with a strict system. Reconcile them on install, not later.
Steps
- Install one component at a time:
npx shadcn@latest add button. Serialize installs; only one process should ownpackage.jsonat a time or the lockfile races. - Open the copied file and reconcile it with the system contract before using it:
- Corners: if the system is square, remove
rounded-*classes or set the radius token to 0. - Color: replace default palette utilities with the system tokens.
- Gradients and shadows: strip any
bg-gradient-*or heavy shadow the system forbids.
- Corners: if the system is square, remove
- Keep the accessibility wiring intact: the
asChildpattern, focus-visible rings, aria attributes, and keyboard handlers. Adapt the look, not the behavior. - Standardize variants once. Edit the
cvavariant map so every usage pulls from the same source instead of one-off overrides at call sites.
Pitfalls
- Overriding styles inline at each call site instead of fixing the component leads to drift. Fix it once in the component file.
- Deleting the focus-visible ring to match a design removes keyboard accessibility. Restyle the ring, do not remove it.
- Running two
shadcn addcommands in parallel corruptscomponents.jsonor the lockfile. Serialize them.
Added 2026-07-01. Back to the Skill Library.

Get Smarter About AI Dev
New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.