ever-just/agentskills/shadcn-tailwind-v4-primitives
Claude Code and agent skill by ever-just/agentskills
- community
Checking that the SKILL.md file is still in the repository.
Scaffold a token-based shadcn/ui + Radix primitive set (select/combobox/command/switch/tooltip/form/drawer/…) matching a codebase's house conventions on Tailwind v4 — semantic-token colors, a global focus ring, no tailwindcss-animate, 44px touch targets, forwardRef like the existing button. Use when an app hand-rolls or fakes controls (native `<select>`s, `title=` tooltips, custom dropdowns, DIY meters), or when standing up shadcn/ui on Tailwind v4.
Install
npx vskill@latest install ever-just/agentskills/shadcn-tailwind-v4-primitivesSKILL.md
The same SKILL.md was published earlier as ever-just/agentskills/shadcn-tailwind-v4-primitives.
shadcn/ui + Radix Primitives on Tailwind v4
Overview
This skill scaffolds a real, accessible component layer — shadcn/ui-style wrappers over Radix primitives — that looks like it was written by the team, not pasted from the docs. The output is a set of new files under components/ui/ (select, combobox, switch, tooltip, drawer, form, …) that every route can adopt in place of native <select>s, title= tooltips, hand-rolled dropdowns, and DIY meters.
Two disciplines make it work and both are non-optional. First: a semantic-token layer must already exist — stock shadcn code references CSS variables like bg-background, border-input, bg-popover; without them every primitive renders unstyled (see dark-mode-token-migration). Second: one shared house-rules contract (templates/house-rules.md) governs color, focus, animation, touch-targets, radius, and types, so a fleet of authoring agents produces one coherent style instead of twenty. Primitives authored this way are dark-ready from birth (tokens), keyboard/AT-accessible (Radix), and touch-correct (44px targets, 16px inputs). This method comes from a real shipped Next.js / Tailwind v4 redesign — every rule below earned its place fixing something that silently broke.
When to use
- "The app is full of native
<select>s /title=tooltips / custom dropdowns — give it a real component library." - "Stand up shadcn/ui on this Tailwind v4 project."
- "We're faking a progress bar / toggle / combobox by hand — replace it with an accessible primitive."
- Before a per-route migration: build the primitive layer once, then swap call-sites onto it (with
parallel-agent-refactor).
When NOT to use this skill
- The app already has a mature component system (Radix already wrapped, MUI, Chakra, Mantine, an in-house kit). Don't fork a second one — extend what's there.
- No semantic-token layer and you're not willing to build one first. Every primitive here assumes tokens. Do
dark-mode-token-migrationfirst, or the whole set ships dead styles. - You need one control, once. Adding
cmdk+vaul+react-hook-formfor a single dropdown is overkill — style one Radix component inline. - Pure visual redesign / taste work →
frontend-design. This skill builds the plumbing; it doesn't pick the aesthetic.
What to build (the faked-control census)
Grep the app for the anti-patterns in the right column, then author the matching primitive as a new file. Authoring new files means a parallel fan-out has zero write conflicts (nobody edits the same file).
Primitive (components/ui/…) | Package | Replaces (the faked control) | |
|---|---|---|---|
select | @radix-ui/react-select | native <select> | |
combobox | popover + command (cmdk) | custom searchable dropdown | |
command | cmdk | hand-built filter list; CommandDialog reuses the base Dialog | |
switch | @radix-ui/react-switch | a styled checkbox / toggle <div> | |
checkbox | @radix-ui/react-checkbox | native <input type="checkbox"> | |
radio-group | @radix-ui/react-radio-group | loose native radios | |
tooltip | @radix-ui/react-tooltip | the title= attribute | |
dropdown-menu | @radix-ui/react-dropdown-menu | a custom absolutely-positioned menu | |
popover | @radix-ui/react-popover | a hand-floated panel | |
tabs | @radix-ui/react-tabs | hand-rolled tab state | |
toggle + toggle-group | @radix-ui/react-toggle + @radix-ui/react-toggle-group | active/inactive button pairs | |
progress | @radix-ui/react-progress | a hand-built meter <div> | |
slider | @radix-ui/react-slider | <input type="range"> | |
separator | @radix-ui/react-separator | <hr> / a bordered div | |
label | @radix-ui/react-label | a bare <label> (consumed by form) | |
textarea | native, styled | an unstyled <textarea> | |
form | react-hook-form + zod + @hookform/resolvers | manual field state + ad-hoc validation | |
drawer | vaul | a custom bottom-sheet | |
CopyButton | house-original (no Radix) | a copy icon with title= |
Dependencies
State these explicitly — never assume they're installed. Install only the packages for the primitives you're actually building.
Prereq that is not an npm package: the semantic-token layer (the CSS-var definitions for --background, --popover, --primary, --border, --input, --accent, --muted, --destructive, … and their -foreground pairs). If bg-popover and border-input don't resolve, stop and build the token layer first — see dark-mode-token-migration.
Authoring discipline (the six house rules)
These are the whole point — hand the full contract in templates/house-rules.md to every authoring agent. The rules, and the why so you generalize past the listed cases:
- Read the existing `button` (and `input`) FIRST. They are the style reference — copy their
"use client"placement, theircnimport path, theirReact.forwardRef+displayNameshape, and their formatting. Every new primitive mirrors them exactly. - Color = semantic tokens ONLY. Use
bg-popover/text-popover-foreground,border-border,border-input,bg-primary/text-primary-foreground,bg-accent/text-accent-foreground,text-muted-foreground,bg-muted,bg-destructive. Never a raw palette shade (bg-gray-100,#1e293b,text-white) for chrome. Tokens are why the set is dark-ready with zero extra work — a raw shade breaks in the other theme. - Focus = rely on the global ring. If the app has a global
:focus-visiblering, do not add per-componentfocus-visible:ring-*/outline-*. Per-component rings drift and fight the global one; one source of truth keeps focus consistent. - Animation = transitions + built-in motion, never `animate-*`. Tailwind v4 ships no `tailwindcss-animate`.
animate-in,animate-out,fade-in-*,zoom-in-*,slide-in-from-*, anddata-[state=…]:animate-*silently render nothing — no error, no warning. Radix exposesdata-[state]attributes you drive withtransition-*/CSS keyframes (it does not animate itself);vaulself-animates. The one blessed state-motion is a chevron:data-[state=open]:rotate-180 transition-transform. - Touch targets. Interactive triggers and menu-items (SelectTrigger, DropdownMenuItem, CommandItem row, TabsTrigger, CopyButton) get
pointer-coarse:min-h-11. Text-entry controls (command input, combobox input, textarea) usetext-sm … pointer-coarse:text-base— 16px on touch, which prevents the iOS focus-zoom trap. Do not ballooncheckbox/switchthemselves (they'd look wrong); enlarge their hit-area by pairing them with alabelinstead. - Radius, border, types.
rounded-mdfor controls,rounded-lg/rounded-xlfor surfaces (popover/menu/sheet), hairlineborderwidths. Type the ref with `React.ComponentRef<…>` and `React.ComponentPropsWithoutRef<…>` —React.ElementRefis@deprecatedin@types/react19.
A reference primitive (annotated)
Every primitive is the canonical shadcn wrapper with the house rules applied. Switch shows all of them in ~20 lines — clone this shape for the rest.
Every other primitive is the same shape with rules 2/4/5/6 applied to its parts:
- Triggers (SelectTrigger, DropdownMenuItem, …) add
pointer-coarse:min-h-11, and for a chevron the one blessed motiondata-[state=open]:rotate-180 transition-transform. - Surfaces (popover / menu / sheet content) use
rounded-lg border bg-popover text-popover-foreground shadow-md— popover tokens, hairline border. - `CopyButton` is fully house-original (no Radix) yet obeys the same rules: token colors, no per-component focus ring,
pointer-coarse:min-h-11.
Full authoring contract + call-site API table: `templates/house-rules.md`. It carries the file-header/forwardRef boilerplate, the per-part patterns, and the Radix→native mapping — hand it to every author verbatim.
Radix API notes for call-sites (hand these to the migrator)
The primitives are NOT drop-in for the native DOM API — e.g. Select gives you onValueChange(value) (not an onChange event), a SelectItem needs a sentinel value like "all" (empty string throws at runtime), Switch/Checkbox use onCheckedChange(boolean), CommandItem uses onSelect. The full call-site mapping is the table in `templates/house-rules.md` §7 — put it in the migration spec when a parallel-agent-refactor migrator rewires call-sites.
Fan-out authorship (parallel, one barrier)
Because every primitive is a new file, you can author the whole set concurrently. Give every author agent the identical templates/house-rules.md + one reference file (the existing button) + a disjoint list of files to create. Group interdependent primitives under a single owner so a cross-file import lands from one hand; the few remaining cross-file imports resolve when all files land together at the end.
| Owner slice | New files it creates | Why grouped | |
|---|---|---|---|
| Overlays | popover, command, combobox | combobox = popover + command; keep them with one owner | |
| Command dialog | command's CommandDialog | reuses the base Dialog — same owner as / after dialog exists | |
| Menus | dropdown-menu | standalone | |
| Toggles | switch, checkbox, radio-group, toggle, toggle-group | independent leaves | |
| Inputs | textarea, slider, label | label is imported by form | |
| Form | form | imports label (cross-file — resolves at the barrier) | |
| Feedback | tooltip, progress, separator | independent | |
| Sheet | drawer (vaul) | standalone | |
| Config / misc | select, tabs, CopyButton | independent |
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shadcn-tailwind-v4-primitives/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 1 Oct 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ever-just/agentskills/shadcn-tailwind-v4-primitives)