shadcn-ui

Install, configure, and customize shadcn/ui components in React and Next.js projects.

Updated May 22, 2026
One-click install
npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill shadcn-ui-viniciuscs84
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn-ui
Source: https://github.com/viniciuscs84/sdd-toolkit/tree/main/skills/shadcn-ui
Command: npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill shadcn-ui-viniciuscs84

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up shadcn/ui involves many moving parts—Tailwind configuration, CSS variables, path aliases, Radix dependencies, and provider wiring—and small mistakes cause broken forms, missing dark mode, or hydration errors. This Skill provides a structured workflow for installing, theming, and troubleshooting shadcn/ui components correctly. ## Core Features & Use Cases - Guided Setup: Step-by-step initialization for new and existing Next.js projects, including verification of components.json, globals.css variables, tailwind.config.js, and tsconfig path aliases. - Component Patterns: Complete working examples for forms with React Hook Form and Zod validation, confirmation dialogs, toast notifications, and provider setup in the root layout. - Theming & Customization: Instructions for editing CSS variables, extending cva variants, and overriding styles via the cn() class-merge utility. - Pitfall Reference: Covers common failures such as missing "use client" directives, Select binding with onValueChange, and dark mode class toggling. - Use Case: When building a login page, use this Skill to install the form, input, button, and card components, wire up Zod validation, and avoid the typical FormField registration mistakes. ## Quick Start Use the shadcn-ui skill to set up shadcn/ui in my Next.js project and build a validated login form.

Frequently Asked Questions about shadcn-ui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install shadcn/ui in a Next.js project?

Create the app with create-next-app using TypeScript and Tailwind flags, then run npx shadcn@latest init. The init prompt configures style, base color, CSS variables, and the component path, generating components.json and the cn utility.

How do I build a validated form with shadcn/ui and React Hook Form?

Install the form, input, and button components, define a Zod schema, and create the form with useForm and zodResolver. Wrap each input in FormField, spread {...field} onto the input, and FormMessage renders validation errors automatically.

Why is my shadcn/ui component not working in Next.js App Router?

Radix-based components use hooks and event handlers, so they fail in React Server Components without the "use client" directive. Add "use client" at the top of any file that imports interactive shadcn components.

How do I enable dark mode with shadcn/ui and Tailwind?

Set darkMode: ["class"] in tailwind.config.js and define the .dark CSS variable overrides in globals.css. Toggle dark mode by adding or removing the dark class on the html element.

Why is my shadcn/ui Select not binding in a form?

Select requires onValueChange={field.onChange} instead of onChange, and defaultValue={field.value} placed on the Select element itself, not on SelectTrigger. Omitting this breaks React Hook Form registration.

Can I customize shadcn/ui components after installing them?

Yes, components are copied into your project source so you own the code. Edit the cva variant config to add variants, change theme colors via CSS variables in globals.css, or pass className which merges through the cn utility.