From craft-workspace-webconsulting-skills
Provides shadcn/ui installation, configuration, and implementation patterns for accessible React components with Tailwind CSS, Radix UI, React Hook Form, and Zod. Use for buttons, dialogs, tables, forms, and themes.
npx claudepluginhub dirnbauer/webconsulting-skillsThis skill uses the workspace's default tool permissions.
Build accessible, customizable UI components with shadcn/ui, Radix UI, and Tailwind CSS.
references/chart.mdreferences/charts-components.mdreferences/customization.mdreferences/forms-and-validation.mdreferences/learn.mdreferences/nextjs-integration.mdreferences/official-ui-reference.mdreferences/reference.mdreferences/setup-and-configuration.mdreferences/ui-components.mdreferences/ui-reference.mdInstalls, configures, and implements shadcn/ui React components with Tailwind CSS, React Hook Form, Zod for accessible UIs like buttons, forms, dialogs, tables.
Manages shadcn/ui components and projects with documentation, CLI guidance, styling rules, form patterns, and composition principles for React/Tailwind UIs.
Manages shadcn/ui components: adds, searches, fixes, debugs, styles, composes UI. Provides project context, docs, examples, and enforces Tailwind/forms best practices.
Share bugs, ideas, or general feedback.
Build accessible, customizable UI components with shadcn/ui, Radix UI, and Tailwind CSS.
npx shadcn@latest add <component>Activate when user requests involve:
| Component | Install Command | Description |
|---|---|---|
button | npx shadcn@latest add button | Variants: default, destructive, outline, secondary, ghost, link |
input | npx shadcn@latest add input | Text input field |
form | npx shadcn@latest add form | React Hook Form integration with validation |
card | npx shadcn@latest add card | Container with header, content, footer |
dialog | npx shadcn@latest add dialog | Modal overlay |
sheet | npx shadcn@latest add sheet | Slide-over panel (top/right/bottom/left) |
select | npx shadcn@latest add select | Dropdown select |
toast | npx shadcn@latest add toast | Notification toasts |
table | npx shadcn@latest add table | Data table |
menubar | npx shadcn@latest add menubar | Desktop-style menubar |
chart | npx shadcn@latest add chart | Recharts wrapper with theming |
textarea | npx shadcn@latest add textarea | Multi-line text input |
checkbox | npx shadcn@latest add checkbox | Checkbox input |
label | npx shadcn@latest add label | Accessible form label |
# New Next.js project
npx create-next-app@latest my-app --typescript --tailwind --eslint --app
cd my-app
npx shadcn@latest init
# Existing project
npm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
npx shadcn@latest init
# Install components
npx shadcn@latest add button input form card dialog select toast
// Button with variants and sizes
import { Button } from "@/components/ui/button"
<Button variant="default">Default</Button>
<Button variant="destructive" size="sm">Delete</Button>
<Button variant="outline" disabled>Loading...</Button>
"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 formSchema = z.object({
email: z.string().email("Invalid email"),
password: z.string().min(8, "Password must be at least 8 characters"),
})
export function LoginForm() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: { email: "", password: "" },
})
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(console.log)} className="space-y-4">
<FormField name="email" control={form.control} render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl><Input type="email" {...field} /></FormControl>
<FormMessage />
</FormItem>
)} />
<FormField name="password" control={form.control} render={({ field }) => (
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl><Input type="password" {...field} /></FormControl>
<FormMessage />
</FormItem>
)} />
<Button type="submit">Login</Button>
</form>
</Form>
)
}
See references/forms-and-validation.md for advanced multi-field forms, contact forms with API submission, and login card patterns.
import { Button } from "@/components/ui/button"
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
<Dialog>
<DialogTrigger asChild>
<Button variant="outline">Open</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
</DialogHeader>
{/* content */}
</DialogContent>
</Dialog>
// 1. Add <Toaster /> to app/layout.tsx
import { Toaster } from "@/components/ui/toaster"
// 2. Use in components
import { useToast } from "@/components/ui/use-toast"
const { toast } = useToast()
toast({ title: "Success", description: "Changes saved." })
toast({ variant: "destructive", title: "Error", description: "Something went wrong." })
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts"
import { ChartContainer, ChartTooltipContent } from "@/components/ui/chart"
const chartConfig = {
desktop: { label: "Desktop", color: "var(--chart-1)" },
} satisfies import("@/components/ui/chart").ChartConfig
<ChartContainer config={chartConfig} className="min-h-[200px] w-full">
<BarChart data={data}>
<CartesianGrid vertical={false} />
<XAxis dataKey="month" />
<Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
<ChartTooltip content={<ChartTooltipContent />} />
</BarChart>
</ChartContainer>
See references/charts-components.md for Line, Area, and Pie chart examples.
"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 formSchema = z.object({
email: z.string().email("Invalid email"),
password: z.string().min(8, "Min 8 characters"),
})
export function LoginForm() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: { email: "", password: "" },
})
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(console.log)} className="space-y-4">
<FormField name="email" control={form.control} render={({ field }) => (
<FormItem>
<FormLabel>Email</FormLabel>
<FormControl><Input type="email" {...field} /></FormControl>
<FormMessage />
</FormItem>
)} />
<FormField name="password" control={form.control} render={({ field }) => (
<FormItem>
<FormLabel>Password</FormLabel>
<FormControl><Input type="password" {...field} /></FormControl>
<FormMessage />
</FormItem>
)} />
<Button type="submit">Login</Button>
</form>
</Form>
)
}
import { ColumnDef } from "@tanstack/react-table"
import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
import { DataTable } from "@/components/ui/data-table"
const columns: ColumnDef<User>[] = [
{ id: "select", header: ({ table }) => (
<Checkbox checked={table.getIsAllPageRowsSelected()} />
), cell: ({ row }) => (
<Checkbox checked={row.getIsSelected()} />
)},
{ accessorKey: "name", header: "Name" },
{ accessorKey: "email", header: "Email" },
{ id: "actions", cell: ({ row }) => (
<Button variant="ghost" size="sm">Edit</Button>
)},
]
import { Button } from "@/components/ui/button"
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
<Dialog>
<DialogTrigger asChild>
<Button variant="outline">Add User</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Add New User</DialogTitle>
</DialogHeader>
{/* <LoginForm /> */}
</DialogContent>
</Dialog>
import { useToast } from "@/components/ui/use-toast"
import { Button } from "@/components/ui/button"
const { toast } = useToast()
toast({ title: "Saved", description: "Changes saved successfully." })
toast({ variant: "destructive", title: "Error", description: "Failed to save." })
"use client" for interactive components (hooks, events)globals.css for consistent design@ alias is configured in tsconfig.jsonnext-themesForm, FormField, FormItem, FormLabel, FormMessage together<Toaster /> once to root layoutnpx shadcn@latest add are fetched remotely; always verify the registry source is trusted before installation"use client" directive@radix-ui packages are installed@ alias in tsconfig.json for importsConsult these files for detailed patterns and code examples:
This skill is based on the excellent work by Giuseppe Trisciuoglio.
Original repository: https://github.com/giuseppe-trisciuoglio/developer-kit
Special thanks to Giuseppe Trisciuoglio for their generous open-source contributions, which helped shape this skill collection. Adapted by webconsulting.at for this skill collection