shadcn-ui
shadcn/ui is a collection of accessible React components (built on Radix UI or Base UI and Tailwind CSS) that you add to your project as source code with a…
от TerminalSkills★ 221 звезда на GitHub
Установить shadcn-ui в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
shadcn/ui
Overview
shadcn/ui is not an npm component library. The shadcn CLI copies component source into your repo (usually components/ui/), so you own and edit every file. Components are styled with Tailwind CSS and CSS variables and sit on Radix UI primitives (newer projects can pick Base UI via --base). Checked against shadcn CLI 4.22.1 and the docs at ui.shadcn.com (October 2026).
Instructions
Set up
# existing project (Next.js, Vite, Remix, Astro, React Router, TanStack, Laravel)
npx shadcn@latest init
# new project from a template
npx shadcn@latest init --name billing-portal --template next
init writes components.json, adds the cn() helper in lib/utils.ts, installs dependencies and sets up theme CSS variables in your global CSS. Useful flags: -t/--template (next, vite, start, react-router, laravel, astro), -b/--base (radix, base, aria), -p/--preset, --monorepo, -d/--defaults (Next.js template with the Base UI base-nova preset, so asChild is replaced by render). create is an alias for init. Also available: pnpm dlx shadcn@latest and bunx --bun shadcn@latest.
Add and inspect components
npx shadcn@latest add button dialog card input field table
npx shadcn@latest add sonner command dropdown-menu sheet tabs
npx shadcn@latest add dialog --dry-run # preview files and dependencies
npx shadcn@latest add button --diff # compare with upstream
npx shadcn@latest add button --overwrite # replace your edited copy
npx shadcn@latest view button card # print registry source
npx shadcn@latest search @shadcn -q "sidebar"
npx shadcn@latest info # show detected framework, aliases, installed components
npx shadcn@latest docs dialog # docs and examples for a component
Components land in the ui alias from components.json (@/components/ui). add also accepts URLs, local paths and namespaced registries such as @acme/auth. apply <preset> re-themes an existing project and migrate runs codemods between versions.
Forms with Field, React Hook Form and Zod
The old Form/FormField wrapper is replaced in the docs by the Field family (Field, FieldGroup, FieldLabel, FieldError, FieldDescription) used with react-hook-form's Controller. Install with npx shadcn@latest add field input button and npm install react-hook-form zod @hookform/resolvers@5 (@hookform/[email protected] currently fails npm's peer resolution with ERESOLVE).
"use client";
import { Controller, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import { Button } from "@/components/ui/button";
import { Field, FieldError, FieldGroup, FieldLabel } from "@/components/ui/field";
import { Input } from "@/components/ui/input";
const schema = z.object({
name: z.string().min(2, "Name must be at least 2 characters"),
email: z.string().email("Invalid email"),
});
type InviteValues = { name: string; email: string };
export function InviteForm({ onInvite }: { onInvite: (v: InviteValues) => void }) {
const form = useForm<InviteValues>({
resolver: zodResolver(schema),
defaultValues: { name: "", email: "" },
});
return (
<form onSubmit={form.handleSubmit(onInvite)}>
<FieldGroup>
{(["name", "email"] as const).map((key) => (
<Controller key={key} name={key} control={form.control} render={({ field, fieldState }) => (
<Field data-invalid={fieldState.invalid}>
<FieldLabel htmlFor={`invite-${key}`}>{key === "name" ? "Name" : "Email"}</FieldLabel>
<Input {...field} id={`invite-${key}`} aria-invalid={fieldState.invalid}
placeholder={key === "name" ? "Priya Raman" : "[email protected]"} />
{fieldState.invalid && <FieldError errors={[fieldState.error]} />}
</Field>
)} />
))}
<Button type="submit">Send invite</Button>
</FieldGroup>
</form>
);
}
Place this form inside <DialogContent> (with Dialog, DialogTrigger asChild, DialogHeader, DialogTitle) for a modal; with the Base UI variant, triggers use the render prop instead of asChild.
Toasts
The Radix toast component is deprecated; use Sonner. Run npx shadcn@latest add sonner, render <Toaster /> once in the root layout, then call toast.success("Invite sent") from sonner anywhere.
Data table
There is no data-table item to add. The docs build it from the table component and TanStack Table v9: npx shadcn@latest add table button dropdown-menu checkbox input and npm install @tanstack/react-table. v9 is feature-based: export features = tableFeatures({ rowPaginationFeature, paginatedRowModel: createPaginatedRowModel(), ... }) for the behavior you need, type columns as ColumnDef<DataTableFeatures, User>[], and create the table with useTable({ features, data, columns }) in a small `
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _scores.json
FAQ
Что делает скилл shadcn-ui?
shadcn/ui is a collection of accessible React components (built on Radix UI or Base UI and Tailwind CSS) that you add to your project as source code with a CLI instead of installing as a dependency. Use when the user asks to "add shadcn", "set up shadcn/ui", "add a shadcn dialog, form, data table, command palette or toast", "customize shadcn components", or build UI with components/ui in Next.js, Vite, Remix, Astro or React Router.
Как установить скилл shadcn-ui?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shadcn-ui запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…