
Shadcn Ui
Install and compose shadcn/ui components with correct variants, forms wiring, and pnpm add commands while building React UIs.
Overview
shadcn-ui is an agent skill for the Build phase that documents install commands, props, and recipes for commonly used shadcn/ui React components.
Install
npx skills add https://github.com/jezweb/claude-skills --skill shadcn-uiWhat is this skill?
- ~15 high-traffic shadcn/ui components with pnpm dlx shadcn@latest add commands
- Button variant and size matrix including icon and loading disabled states
- Form stack requiring react-hook-form, zod, and @hookform/resolvers
- react-hook-form gotcha: pass field props individually instead of spreading {...field}
- Card, Input+Label, and linked shadcn docs for full catalogue
- ~15 most-used shadcn/ui components
Adoption & trust: 2.8k installs on skills.sh; 841 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent invents shadcn component APIs or botches react-hook-form integration on new screens.
Who is it for?
Solo builders on Next.js or Vite React stacks who standardize on shadcn/ui for fast SaaS UI.
Skip if: Vue or Svelte projects, fully custom design systems without shadcn, or backend-only work.
When should I use this skill?
When implementing or extending React UIs that use shadcn/ui components, forms, or pnpm-based adds.
What do I get? / Deliverables
Screens use documented pnpm add steps, variant names, and Form patterns that match shadcn/ui conventions.
- pnpm dlx add commands per component
- TSX usage snippets with variants
- Form composition notes tied to recipes.md
Recommended Skills
Journey fit
How it compares
Component cheat sheet skill—not the shadcn CLI itself or a Figma-to-code pipeline.
Common Questions / FAQ
Who is shadcn-ui for?
Developers using shadcn/ui with React who want agents to emit correct install commands, variants, and form wiring.
When should I use shadcn-ui?
Use during Build frontend tasks when adding buttons, cards, inputs, or zod-backed forms to a Tailwind React app.
Is shadcn-ui safe to install?
The skill is documentation-only; review the Security Audits panel on this page and run shadcn CLI yourself in trusted projects.
SKILL.md
READMESKILL.md - Shadcn Ui
# Component Catalogue The ~15 most-used shadcn/ui components with install commands, key props, and gotchas. Not exhaustive — see [shadcn/ui docs](https://ui.shadcn.com) for the full list. ## Button ```bash pnpm dlx shadcn@latest add button ``` **Variants**: `default`, `destructive`, `outline`, `secondary`, `ghost`, `link` **Sizes**: `default`, `sm`, `lg`, `icon` ```tsx <Button variant="outline" size="sm" onClick={handleClick}>Save</Button> <Button variant="ghost" size="icon"><Trash className="h-4 w-4" /></Button> <Button disabled={isPending}>{isPending ? 'Saving...' : 'Save'}</Button> ``` ## Input + Label ```bash pnpm dlx shadcn@latest add input label ``` ```tsx <div className="space-y-2"> <Label htmlFor="email">Email</Label> <Input id="email" type="email" placeholder="you@example.com" /> </div> ``` **Note**: When using with react-hook-form, don't spread `{...field}` — pass props individually to avoid null value issues. ## Card ```bash pnpm dlx shadcn@latest add card ``` ```tsx <Card> <CardHeader> <CardTitle>Title</CardTitle> <CardDescription>Description</CardDescription> </CardHeader> <CardContent>Body</CardContent> <CardFooter>Footer</CardFooter> </Card> ``` ## Form ```bash pnpm dlx shadcn@latest add form pnpm add react-hook-form zod @hookform/resolvers ``` Wraps react-hook-form with shadcn styling. See [recipes.md](recipes.md) for complete form examples. **Key exports**: `Form`, `FormField`, `FormItem`, `FormLabel`, `FormControl`, `FormMessage` ## Dialog ```bash pnpm dlx shadcn@latest add dialog ``` ```tsx <Dialog open={open} onOpenChange={setOpen}> <DialogTrigger asChild><Button>Open</Button></DialogTrigger> <DialogContent className="sm:max-w-md"> <DialogHeader> <DialogTitle>Title</DialogTitle> <DialogDescription>Description</DialogDescription> </DialogHeader> {/* content */} <DialogFooter> <Button onClick={() => setOpen(false)}>Close</Button> </DialogFooter> </DialogContent> </Dialog> ``` **Gotcha**: Override width with `sm:max-w-*` (must match breakpoint prefix). ## Sheet ```bash pnpm dlx shadcn@latest add sheet ``` Side panel — commonly used for mobile navigation. ```tsx <Sheet> <SheetTrigger asChild><Button variant="ghost" size="icon"><Menu /></Button></SheetTrigger> <SheetContent side="left"> <SheetHeader><SheetTitle>Navigation</SheetTitle></SheetHeader> {/* nav links */} </SheetContent> </Sheet> ``` **Sides**: `left`, `right`, `top`, `bottom` ## Table ```bash pnpm dlx shadcn@latest add table ``` Static table. For sortable/filterable data tables, also install `@tanstack/react-table`. See [recipes.md](recipes.md) for the data table pattern. ```tsx <Table> <TableHeader> <TableRow><TableHead>Name</TableHead><TableHead>Email</TableHead></TableRow> </TableHeader> <TableBody> {users.map(u => ( <TableRow key={u.id}> <TableCell>{u.name}</TableCell> <TableCell>{u.email}</TableCell> </TableRow> ))} </TableBody> </Table> ``` ## Select ```bash pnpm dlx shadcn@latest add select ``` ```tsx <Select value={value} onValueChange={setValue}> <SelectTrigger><SelectValue placeholder="Choose..." /></SelectTrigger> <SelectContent> <SelectItem value="option1">Option 1</SelectItem> <SelectItem value="option2">Option 2</SelectItem> </SelectContent> </Select> ``` **Gotcha**: No empty string values. Use `"__any__"` sentinel for "All" options. ## Toast (Sonner) ```bash pnpm dlx shadcn@latest add toast pnpm add sonner ``` Add `<Toaster />` to your root layout, then: ```tsx import { toast } from 'sonner' toast.success('Saved successfully') toast.error('Something went wrong') toast.promise(saveData(), { loading: 'Saving...', success: 'Saved!', error: 'Failed to save', }) ``` ## Tabs ```bash pnpm dlx shadcn@latest add tabs ``` ```tsx <Tabs defaultValue="general"> <TabsList> <TabsTrigger value="general">General</TabsTrigger> <TabsTrigger value="security">Sec