shadcn-ui-setup
Skill0 starsChanged 3 months agoMITView on GitHub
Initializes and extends shadcn/ui in Next.js: init command, essential components, Tooltip/Dialog providers, form wiring, and reusable UI patterns. Use when adding shadcn, Radix primitives, component libraries, tooltips, dialogs, selects, or building form-heavy UIs.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- CrowPus/Zelyqtheir own version, first seen Aug 22, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- CrowPus/Zelyq★ 10same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- client-document-exportSkill
- cloudflare-turnstile-nextjsSkill
- ga4-analytics-nextjsSkill
- git-repo-privacy-auditSkill
- hardened-contact-form-nextjsSkill
- html-semantic-markupSkill
- multi-step-wizard-flowSkill
- nextjs-api-routesSkill
- nextjs-app-routerSkill
- nextjs-seo-metadataSkill
- nextjs-ui-foundationSkill
- next-themes-dark-modeSkill
- playwright-e2e-testingSkill
- react-components-patternsSkill
- react-hooks-patternsSkill
- recharts-dashboardSkill
- resend-email-nextjsSkill
- server-pdf-playwrightSkill
- specialized-form-inputsSkill
- tailwind-css-v4Skill
- vitest-unit-testingSkill
- web-accessibility-wcagSkill
- zustand-persist-stateSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Add these before feature work — most apps need them:
- Distinctive: line 113
Use Dialog (not page navigation) for inline CRUD:
- Distinctive: line 133
Use grouped options for year/decade pickers and long lists.
- Very specific: line 139
Use cva for variants on repeated patterns (badges, buttons)
- Very specific: line 144
Every icon-only button needs aria-label
- Very specific: line 147
Never nest <button> inside <button> — use role="group" row pattern (see react-components-patterns)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
shadcn/ui Setup
Init (new project)
npx shadcn@latest initDefaults: New York style, zinc/slate base, CSS variables, @/components, @/lib/utils.
Install components upfront
Add these before feature work — most apps need them:
npx shadcn@latest add button input label textarea select dialog sheet \
dropdown-menu tooltip popover separator badge card progress tabsFor forms:
npx shadcn@latest add form checkbox radio-group switch
npm install react-hook-form @hookform/resolvers zodFor dates (calendar popover):
npx shadcn@latest add calendar
npm install date-fns react-day-pickercn() utility
Ensure src/lib/utils.ts exports:
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}Global providers
Wrap app once in root layout:
import { TooltipProvider } from "@/components/ui/tooltip";
<TooltipProvider delayDuration={300}>
{children}
</TooltipProvider>For shadcn forms, no extra provider needed.
Help tooltip pattern
Reusable contextual help (keeps copy out of JSX):
// components/ui/help-tooltip.tsx
export function HelpTooltip({ content, ariaLabel = "More info" }: { content: React.ReactNode; ariaLabel?: string }) {
return (
<Tooltip>
<TooltipTrigger asChild>
<button type="button" aria-label={ariaLabel} className="text-muted-foreground">
<Info className="h-4 w-4" />
</button>
</TooltipTrigger>
<TooltipContent side="top" className="max-w-xs">{content}</TooltipContent>
</Tooltip>
);
}Centralize copy in lib/help-text.ts keyed by field/feature.
Form pattern (RHF + Zod + shadcn Form)
const schema = z.object({ email: z.string().email(), name: z.string().min(1) });
const form = useForm<z.infer<typeof schema>>({ resolver: zodResolver(schema), defaultValues: { email: "", name: "" } });
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<FormField control={form.control} name="email" render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl><Input {...field} /></FormControl>
<FormMessage />
</FormItem>
)} />
<Button type="submit">Save</Button>
</form>
</Form>Dialog for create/edit flows
Use Dialog (not page navigation) for inline CRUD:
- List view shows items + "Add" card
- Dialog hosts form;
onOpenChangeresets form state - Primary action validates before close
Select with groups
Wrap shadcn Select for app-specific API:
interface AppSelectProps {
options?: { value: string; label: string }[];
groups?: { label: string; options: { value: string; label: string }[] }[];
value: string;
onChange: (value: string) => void;
placeholder?: string;
}Use grouped options for year/decade pickers and long lists.
Component conventions
"use client"only on interactive components- Primitives in
components/ui/; feature components incomponents/{feature}/ - Use
cvafor variants on repeated patterns (badges, buttons) - Icons:
lucide-react, consistenth-4 w-4in buttons
Accessibility defaults
- Every icon-only button needs
aria-label - Dialog: focus trap handled by Radix; provide
DialogTitle - Form fields: associate
<Label htmlFor>with inputid - Never nest
<button>inside<button>— userole="group"row pattern (seereact-components-patterns)
Related skills
tailwind-css-v4— theme tokens andcn()specialized-form-inputs— currency/DOB beyond shadcn defaultsweb-accessibility-wcag— landmarks, axe testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

