shadcn/ui Skills for Next.js 16
Installation, components, blocks, forms, theming, and MCP guidance for shadcn/ui in modern Next.js projects using pnpm
What this skill does
# shadcn/ui Skills
**Status:** Next.js 16 ready
**Package Manager:** pnpm (required)
**Official Docs:**
- [Installation (Next.js)](https://ui.shadcn.com/docs/installation/next)
- [Components](https://ui.shadcn.com/docs/components)
- [Blocks](https://ui.shadcn.com/blocks)
- [Sonner (toast replacement)](https://ui.shadcn.com/docs/components/sonner)
- [Forms](https://ui.shadcn.com/docs/components/form)
- [Dark Mode (Next.js)](https://ui.shadcn.com/docs/dark-mode/next)
- [MCP Server](https://ui.shadcn.com/docs/mcp)
- [LLM Guidelines](https://ui.shadcn.com/llms.txt)
---
## Table of Contents
1. [Installation & Setup](#installation--setup)
2. [Project Configuration (Next.js 16)](#project-configuration-nextjs-16)
3. [Components & Usage](#components--usage)
4. [Blocks](#blocks)
5. [Forms](#forms)
6. [Sonner (Toast Replacement)](#sonner-toast-replacement)
7. [Dark Mode](#dark-mode)
8. [MCP Integration](#mcp-integration)
9. [Best Practices](#best-practices)
---
## Installation & Setup
- Use pnpm for all commands.
- Scaffold shadcn/ui in an existing Next.js 16 app:
```bash
pnpm dlx shadcn@latest init
```
- Accept prompts for **Next.js** + **TypeScript**.
- CLI creates `components.json` and installs required deps (Tailwind, class utilities).
- Add components when needed (keeps bundle small):
```bash
pnpm dlx shadcn@latest add button card input textarea select
# add blocks or utilities on demand
```
- After adding components, run:
```bash
pnpm lint && pnpm test # if configured
pnpm dev # verify styles render
```
---
## Project Configuration (Next.js 16)
- Tailwind is required. Ensure `tailwind.config.(ts|js)` includes shadcn paths:
```ts
// tailwind.config.ts
import type { Config } from "tailwindcss"
import { fontFamily } from "tailwindcss/defaultTheme"
const config: Config = {
darkMode: ["class"],
content: [
"./app/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
],
theme: {
extend: {
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
},
},
},
plugins: [require("tailwindcss-animate")],
}
export default config
```
- Use App Router and Server Components by default; mark client files with `"use client"`.
- Keep `globals.css` with CSS variables from shadcn init; do not remove the color tokens.
---
## Components & Usage
- Components live in `components/ui`. Import directly:
```tsx
import { Button } from "@/components/ui/button"
export function CTA() {
return <Button size="lg">Get started</Button>
}
```
- Many components support `asChild` to compose with links:
```tsx
<Button asChild>
<Link href="/docs">Docs</Link>
</Button>
```
- Keep icons in `components/ui/icons` or use `lucide-react` (installed during init).
- Reference component docs for props and accessibility expectations.
---
## Blocks
- Blocks are higher-level page sections from [ui.shadcn.com/blocks](https://ui.shadcn.com/blocks).
- Add a block via CLI (preferred to avoid copy/paste drift):
```bash
pnpm dlx shadcn@latest add blocks/application-shells/sidebar-02
```
- Blocks follow the same theming and Tailwind tokens as core components; adjust spacing/tokens instead of rewriting styles.
- Keep blocks in `components/blocks/*` to avoid mixing with low-level UI primitives.
---
## Forms
- Use the provided Form primitives with `react-hook-form` + `@hookform/resolvers/zod`:
```tsx
"use client"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
import { z } from "zod"
import { Button } from "@/components/ui/button"
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"
import { Input } from "@/components/ui/input"
const schema = z.object({
email: z.string().email(),
name: z.string().min(2),
})
export function ProfileForm() {
const form = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
defaultValues: { email: "", name: "" },
})
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(console.log)} className="space-y-4">
<FormField
control={form.control}
name="email"
render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl>
<Input placeholder="[email protected]" {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button type="submit">Save</Button>
</form>
</Form>
)
}
```
- Keep validation schemas colocated; surface errors via `FormMessage`.
---
## Sonner (Toast Replacement)
- `toast` is **deprecated**; use Sonner.
- Add the Sonner component via CLI:
```bash
pnpm dlx shadcn@latest add sonner
```
- Mount once in your root layout or top-level provider:
```tsx
import { Toaster } from "@/components/ui/sonner"
import { toast } from "sonner"
export function RootProviders({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<Toaster richColors position="top-right" />
</>
)
}
// usage
toast.success("Profile saved")
```
- Keep Sonner provider outside `app/(marketing)` vs `app/(dashboard)` duplication to avoid multiple toasters.
---
## Dark Mode
- Use class-based theming with `next-themes`.
- Example provider (`components/theme-provider.tsx`):
```tsx
"use client"
import { ThemeProvider as NextThemesProvider } from "next-themes"
export function ThemeProvider({ children }: { children: React.ReactNode }) {
return (
<NextThemesProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
{children}
</NextThemesProvider>
)
}
```
- Wrap the App Router layout:
```tsx
// app/layout.tsx
import { ThemeProvider } from "@/components/theme-provider"
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body>
<ThemeProvider>{children}</ThemeProvider>
</body>
</html>
)
}
```
- Keep `suppressHydrationWarning` on `<html>` to avoid mismatches when switching themes.
---
## MCP Integration
- shadcn/ui ships an MCP server (see [docs](https://ui.shadcn.com/docs/mcp)) so agents can browse/add components and blocks safely.
- Register the server in your MCP client config, pointing at your project root where `components.json` lives.
- Prefer MCP-driven adds over manual copy/paste to keep component versions consistent with the catalog.
---
## Best Practices
1. **Stay modular:** Add only the components/blocks you need; trim unused files to keep bundles small.
2. **Respect tokens:** Do not hardcode colors; use the CSS variables set up by init.
3. **Accessibility:** Keep aria labels, roles, and keyboard interactions from the upstream examples.
4. **Typography:** Use CSS variables + `next/font` to load fonts; wire them into `--font-sans` in `globals.css`.
5. **LLM usage:** Follow [llms.txt](https://ui.shadcn.com/llms.txt) when generating code; prefer pnpm commands and Sonner over legacy toast.
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.