--- name: nextjs-shadcn argument-hint: "[component or page]" description: Creates Next.js frontends with shadcn/ui. Use when building React UIs, components, pages, or applications with shadcn, Tailwind, or modern frontend patterns. Also use when the user asks to create a new Next.js project, add UI components, style pages, or build any web interface — even if they don't mention shadcn explicitly. --- # Next.js + shadcn/ui Build distinctive, production-grade interfaces that avoid generic "AI slop" aesthetics. ## Core Principles 1. **Minimize noise** - Icons communicate; excessive labels don't 2. **No generic AI-UI** - Avoid purple gradients, excessive shadows, predictable layouts 3. **Context over decoration** - Every element serves a purpose 4. **Theme consistency** - Use CSS variables from `globals.css`, never hardcode colors ## Quick Start ```bash bunx --bun shadcn@latest init --template next --base base ``` `--base` selects the primitive library: `base` (Base UI, the default), `radix` (legacy projects), or `aria` (React Aria). **The same component has different props per base**, and the docs are base-scoped (`/docs/components/base/sidebar` vs `/docs/components/radix/sidebar`). For a custom design system, generate a preset code in `shadcn/create` and apply it: ```bash bunx --bun shadcn@latest init --preset --template next ``` ### Before touching an existing project ```bash bunx --bun shadcn@latest info --json # base, framework, aliases, installed components bunx --bun shadcn@latest docs # API reference resolved to THIS project's base ``` Run these instead of writing component code from memory. See [references/shadcn-platform.md](references/shadcn-platform.md) for the full CLI surface, typeset, and the shimmer/scroll-fade utilities. ## Component Rules ### Page Structure ```tsx // page.tsx - content only, no layout chrome export default function Page() { return ( <> ); } // layout.tsx - shared UI (header, footer, sidebar) export default function Layout({ children }: { children: React.ReactNode }) { return ( <>
{children}