Claude Code Prompts for shadcn/ui

Copy-paste Claude Code prompts for shadcn/ui — installing components, customizing without losing upgrade path, theme overrides, and Radix accessibility checks.

💥 50p impulse-buy: Power Prompts PDF (first 10 buyers) 30 battle-tested Claude Code prompts · 8-page PDF · paste into CLAUDE.md and never re-type a prompt again · 50p impulse-buy, no commitment

shadcn/ui isn't a library — the components are pasted into your repo. That makes them yours to edit, but also means custom changes block clean upgrades. The prompts below keep shadcn vendored and unmodified while still letting you build branded components on top.

Prompt 1 — Add a new shadcn primitive

I need a Combobox. Walk me through adding it via shadcn CLI.

1. Run: npx shadcn@latest add combobox
2. Verify it landed in src/components/ui/ — list what files it touched.
3. Check if it required new packages — if so, what?
4. Check the existing tailwind.config / @theme — does it use any tokens that
   aren't in our system? If so, list the gaps.
5. Add ONE example usage at src/components/examples/ComboboxDemo.tsx — read
   one of the other examples in that folder as the template.

Do NOT modify the generated src/components/ui/combobox.tsx — it stays
exactly as shadcn shipped it. Wrappers come next.

Prompt 2 — Branded wrapper that preserves upgradability

Build a branded Button used across the app at src/components/branded/
BrandedButton.tsx that:
- Wraps the shadcn Button from src/components/ui/button.tsx — does NOT modify it.
- Adds variants 'primary' | 'ghost-brand' | 'danger-soft' that map to specific
  Tailwind classes using our design tokens (see app.css @theme).
- Forwards all other Button props via Pick + ComponentProps.
- Forwards ref via React.forwardRef.

Constraints:
- The base shadcn Button file MUST be untouched — if we re-run npx
  shadcn@latest add button, our wrapper still works.
- Use the cn() helper from src/lib/utils.ts to merge classes.
- Add 3 stories in src/components/branded/BrandedButton.stories.tsx
  (Storybook 8).
- Update every existing usage of 

Prompt 3 — Accessibility audit on Radix-backed components

Run an a11y audit on the dialog/dropdown-menu/popover usages in src/features/.

For each usage:
- Does the trigger have an accessible name (aria-label or visible text)?
- Does the Dialog have a  (Radix prints a console warning if missing)?
- Are interactive children using Radix's *.Item / *.Trigger, not raw 

CLAUDE.md for shadcn

## shadcn/ui policy
- src/components/ui/ is vendored from shadcn. NEVER edit those files.
- Customisation via wrapper components in src/components/branded/.
- Theme tokens come from app.css @theme (Tailwind v4).
- Add components via 'npx shadcn@latest add '. Never copy-paste from docs.
- A11y: keep Radix structure intact (Trigger, Content, Item) — those carry
  the keyboard/ARIA behaviour.

Related: Tailwind v4 prompts.

Frequently asked questions

Does Claude use the new shadcn CLI?
Yes — npx shadcn@latest add . If you've vendored the components into your repo (the typical pattern), tell Claude `Components live under src/components/ui/. Edit them directly — they are vendored, not a dependency.`
How do I keep shadcn upgrades clean?
The components are copy-pasted into your repo, so 'upgrade' means re-running the CLI. Tell Claude `Never restructure the shadcn/ui components beyond what the CLI generates — only style overrides via cn() and our design tokens. Behaviour changes go in wrapper components.` This keeps re-running the CLI safe.
Can Claude write a wrapper that doesn't break the upgrade path?
Yes — see prompt 2 below. The pattern is to keep src/components/ui/ untouched and add a thin wrapper in src/components//.

Free tools

Cost Calculator → API Cookbook → Diff Summarizer → Skills Browser →

More examples

Claude API Python QuickstartClaude API Node.js / TypeScript QuickstartClaude API Streaming in PythonClaude API Streaming in Node.js / TypeScriptClaude API Tool Use in PythonClaude API Tool Use in Node.js / TypeScript