Shadcn Skills
Installation, components, blocks, forms, theming, and MCP guidance for shadcn/ui in modern Next.js projects using pnpm
от gocallum★ 23 звезды на GitHub
Установить Shadcn Skills в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
shadcn/ui Skills
Status: Next.js 16 ready
Package Manager: pnpm (required)
Official Docs:
- Installation (Next.js)
- Components
- Blocks
- Sonner (toast replacement)
- Forms
- Dark Mode (Next.js)
- MCP Server
- LLM Guidelines
Table of Contents
- Installation & Setup
- Project Configuration (Next.js 16)
- Components & Usage
- Blocks
- Forms
- Sonner (Toast Replacement)
- Dark Mode
- MCP Integration
- Best Practices
Installation & Setup
- Use pnpm for all commands.
- Scaffold shadcn/ui in an existing Next.js 16 app:
pnpm dlx shadcn@latest init- Accept prompts for Next.js + TypeScript.
- CLI creates
components.jsonand installs required deps (Tailwind, class utilities).
- Add components when needed (keeps bundle small):
pnpm dlx shadcn@latest add button card input textarea select # add blocks or utilities on demand - After adding components, run:
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:// 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.csswith CSS variables from shadcn init; do not remove the color tokens.
Components & Usage
- Components live in
components/ui. Import directly:import { Button } from "@/components/ui/button" export function CTA() { return <Button size="lg">Get started</Button> } - Many components support
asChildto compose with links:<Button asChild> <Link href="/docs">Docs</Link> </Button> - Keep icons in
components/ui/iconsor uselucide-react(installed during init). - Reference component docs for props and accessibility expectations.
Blocks
- Blocks are higher-level page sections from ui.shadcn.com/blocks.
- Add a block via CLI (preferred to avoid copy/paste drift):
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:"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)
toastis deprecated; use Sonner.- Add the Sonner component via CLI:
pnpm dlx shadcn@latest add sonner - Mount once in yo
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Shadcn Skills?
Installation, components, blocks, forms, theming, and MCP guidance for shadcn/ui in modern Next.js projects using pnpm
Как установить скилл Shadcn Skills?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Shadcn Skills запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…