shadcn/ui¶
The shadcn pack imitates shadcn/ui in its default new-york style with the neutral base
colour — the React components built on Radix primitives and styled with Tailwind CSS v4. It
uses the library's CSS variables as tokens (--background #ffffff / #0a0a0a, --primary
#171717 / #e5e5e5, --muted #f5f5f5 / #262626, --border #e5e5e5 / white 10 %,
--radius 0.625rem, --chart-1…5), the Geist / system sans stack at 14 px, h-9 controls with
shadow-xs, rounded-xl cards with shadow-sm, and a ring focus style. Dark mode is the .dark
class palette. Select it with import Shadcn (or import ShadcnUI, import Radix).
Elements use the component names of the library: Button (variant: .default | .secondary |
.destructive | .outline | .ghost | .link, size: .sm | .lg | .icon), Badge, Card (with
description:, an action: slot and a footer: slot, or CardHeader / CardTitle /
CardDescription / CardContent / CardFooter), Input, Label, Textarea, Select /
SelectItem, Combobox, Command / CommandInput / CommandGroup / CommandItem,
CommandDialog, Checkbox, RadioGroup / RadioGroupItem, Switch, Slider, Toggle,
ToggleGroup, InputOTP, DatePicker, Calendar, Avatar, Alert, AlertDialog, Dialog,
Sheet, Drawer, DropdownMenu (+ Label, Item, CheckboxItem, Separator, shortcuts),
ContextMenu, Menubar, NavigationMenu, Popover, HoverCard, Tooltip, Tabs /
TabsContent, Accordion / AccordionItem, Collapsible, Table, DataTable, Pagination,
Breadcrumb, Progress, Skeleton, Separator, ScrollArea, the Sidebar family
(SidebarProvider, SidebarGroup, SidebarMenuButton, SidebarInset, SidebarTrigger),
Sonner, Chart, Carousel, Kbd, AspectRatio, ResizablePanelGroup / ResizablePanel /
ResizableHandle and the Typography* styles. Lucide icon names (settings, circle-user,
chevrons-up-down, log-out, credit-card, trending-up …) map onto the built-in icon set.
The custom components below (TeamSwitcher, NavUser, SiteHeader, SectionCard, SwitchRow,
MailItem, PlanCard) live in mockups/shadcn/blocks.mockitdown and are imported with
import "shadcn/blocks".
Login¶
The login-03 block: a card with an action link, two fields, a primary button, a labelled
separator and an outline "Login with Google" button.
Source
import Shadcn
Card("Login to your account", description: "Enter your email below to login to your account") {
VStack(alignment: .stretch, spacing: 24) {
Input("m@example.com", label: "Email", text: "m@example.com")
VStack(alignment: .stretch, spacing: 8) {
HStack {
Label("Password")
Spacer()
Link("Forgot your password?")
}
Input("Password", type: .password, text: "hunter2hunter2").state(.focused)
}
}
} action: {
Button("Sign Up", variant: .link)
} footer: {
VStack(alignment: .stretch, spacing: 16) {
Button("Login").frame(maxWidth: .infinity)
Separator(label: "Or continue with")
Button("Login with Google", systemImage: "globe", variant: .outline).frame(maxWidth: .infinity)
}
}
.frame(width: 384)Pricing¶
A marketing page: NavigationMenu with an open item, a hero with Badge and typography, a
Tabs billing switch, three PlanCards and an Accordion FAQ.
Settings form¶
Inputs with descriptions, a Select, a DatePicker, a RadioGroup, Switch rows in bordered
boxes and a Checkbox, inside Tabs and two cards.
Source
import Shadcn
import "shadcn/blocks"
VStack(alignment: .stretch, spacing: 24) {
VStack(alignment: .leading, spacing: 4) {
TypographyH3("Settings")
TypographyMuted("Manage your account settings and set e-mail preferences.")
}
Separator()
Tabs(selection: "Account") {
TabsContent("Account") {
HStack(alignment: .top, spacing: 24) {
Card("Profile", description: "This is how others will see you on the site.") {
Input("shadcn", label: "Username", text: "shadcn",
description: "This is your public display name. It can be your real name or a pseudonym.")
Select("Select a verified email to display", label: "Email",
description: "You can manage verified email addresses in your email settings.") {
SelectItem("m@example.com")
SelectItem("m@google.com")
}
Textarea("Tell us a little bit about yourself", label: "Bio", text: "I own a computer.", rows: 3)
DatePicker("Date of birth", selection: "1994-05-14", format: .long,
description: "Your date of birth is used to calculate your age.")
Slider(value: 40, in: 0...100, label: "Profile visibility")
} footer: {
Button("Update profile")
}
Card("Notifications", description: "Choose what we email you about.") {
RadioGroup("Notify me about…", selection: "Direct messages and mentions") {
RadioGroupItem("All new messages")
RadioGroupItem("Direct messages and mentions")
RadioGroupItem("Nothing")
}
VStack(alignment: .stretch, spacing: 12) {
Text("Email Notifications").font(.headline)
SwitchRow("Communication emails", "Receive emails about your account activity.")
SwitchRow("Marketing emails", "Receive emails about new products, features, and more.", on: true)
SwitchRow("Security emails", "Receive emails about your account security.", on: true)
}
Checkbox("Use different settings for my mobile devices", checked: true)
} footer: {
Button("Save preferences")
Button("Cancel", variant: .ghost)
}
}
}
TabsContent("Password")
TabsContent("Notifications")
TabsContent("Billing")
}
}
.padding(40)Booking on a phone¶
A responsive flow at phone width: Carousel, Calendar, an outline ToggleGroup, a Slider,
and an open Drawer holding an InputOTP.
Command palette¶
CommandDialog open over a documentation page whose search button shows a Kbd shortcut.
Data table¶
The TanStack-based DataTable pattern: a filter Input and a column-visibility DropdownMenu
in the toolbar, row selection, a sortable column and a "Previous / Next" footer.
| Status | Amount | |||
|---|---|---|---|---|
| Success | ken99@example.com | $316.00 | ||
| Success | abe45@example.com | $242.00 | ||
| Processing | monserrat44@example.com | $837.00 | ||
| Success | silas22@example.com | $874.00 | ||
| Failed | carmella@example.com | $721.00 |
| Status | Amount | |||
|---|---|---|---|---|
| Success | ken99@example.com | $316.00 | ||
| Success | abe45@example.com | $242.00 | ||
| Processing | monserrat44@example.com | $837.00 | ||
| Success | silas22@example.com | $874.00 | ||
| Failed | carmella@example.com | $721.00 |
Source
import Shadcn
VStack(alignment: .stretch, spacing: 0) {
DataTable(columns: ["Status", "Email", TableHead("Amount", alignment: .trailing), ""],
rows: [
["Success", "ken99@example.com", "$316.00", Button(systemImage: "ellipsis", variant: .ghost, size: .icon)],
["Success", "abe45@example.com", "$242.00", Button(systemImage: "ellipsis", variant: .ghost, size: .icon)],
["Processing", "monserrat44@example.com", "$837.00", Button(systemImage: "ellipsis", variant: .ghost, size: .icon)],
["Success", "silas22@example.com", "$874.00", Button(systemImage: "ellipsis", variant: .ghost, size: .icon)],
["Failed", "carmella@example.com", "$721.00", Button(systemImage: "ellipsis", variant: .ghost, size: .icon)]
],
selectedRows: [1, 2], sortColumn: 1) {
} toolbar: {
Input("Filter emails...").frame(width: 384)
Spacer()
DropdownMenu("Columns", open: true) {
DropdownMenuCheckboxItem("Status", checked: true)
DropdownMenuCheckboxItem("Email", checked: true)
DropdownMenuCheckboxItem("Amount", checked: false)
}
} footer: {
Text("2 of 5 row(s) selected.")
Button("Previous", variant: .outline, size: .sm).disabled()
Button("Next", variant: .outline, size: .sm)
}
}
.padding(32)Row actions, confirmation and toast¶
The states around a destructive action: the row's DropdownMenu open, the AlertDialog asking
for confirmation and a Sonner toast from the previous action, on a page with a Breadcrumb, a
destructive Alert, a Table, Pagination and a Tooltip.
| Invoice | Status | Method | Amount | |
|---|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 | |
| INV002 | Pending | PayPal | $150.00 | |
| INV003 | Unpaid | Bank Transfer | $350.00 | |
| INV004 | Paid | Credit Card | $450.00 |
Mail¶
The mail example: three ResizablePanels with handles — navigation with counts, a filtered
message list of MailItems, and the open message with a reply box.
Please come prepared with any questions or insights you may have. Looking forward to our meeting!
Best regards, William
Dashboard¶
The dashboard-01 block: an inset Sidebar with a team header, grouped SidebarMenuButtons and a
user footer; a SiteHeader; four SectionCards with trend Badges; an area Chart card with a
ToggleGroup; and a DataTable under Tabs.
| Header | Section Type | Status | Target | Limit | Reviewer | ||
|---|---|---|---|---|---|---|---|
| Cover page | Cover page | In Process | 18 | 5 | Eddie Lake | ||
| Table of contents | Table of contents | Done | 29 | 24 | Eddie Lake | ||
| Executive summary | Narrative | Done | 10 | 13 | Jamik Tashpulatov | ||
| Technical approach | Narrative | In Process | 27 | 23 | Assign reviewer |
Source
import Shadcn
import "shadcn/blocks"
SidebarProvider {
Sidebar(variant: .inset) {
SidebarGroup {
HStack(spacing: 8) {
Button("Quick Create", systemImage: "circle-plus").frame(maxWidth: .infinity)
Button(systemImage: "mail", variant: .outline, size: .icon)
}
SidebarMenuButton("Dashboard", systemImage: "layout-dashboard", selected: true)
SidebarMenuButton("Lifecycle", systemImage: "list-checks")
SidebarMenuButton("Analytics", systemImage: "chart-bar")
SidebarMenuButton("Projects", systemImage: "folder")
SidebarMenuButton("Team", systemImage: "users")
}
SidebarGroup("Documents") {
SidebarMenuButton("Data Library", systemImage: "database")
SidebarMenuButton("Reports", systemImage: "file-text")
SidebarMenuButton("Word Assistant", systemImage: "file")
}
Spacer()
SidebarGroup {
SidebarMenuButton("Settings", systemImage: "settings")
SidebarMenuButton("Get Help", systemImage: "circle-help")
SidebarMenuButton("Search", systemImage: "search")
}
} header: {
TeamSwitcher(name: "Acme Inc.", plan: "Enterprise")
} footer: {
NavUser(name: "shadcn", email: "m@example.com", photo: "assets/images/avatar-1.svg")
}
SidebarInset {
SiteHeader(title: "Documents") {
Button("GitHub", variant: .ghost, size: .sm)
}
ScrollArea {
VStack(alignment: .stretch, spacing: 24) {
Grid(columns: 4, spacing: 16) {
SectionCard(label: "Total Revenue", value: "$1,250.00", trend: "+12.5%",
note: "Trending up this month", detail: "Visitors for the last 6 months")
SectionCard(label: "New Customers", value: "1,234", trend: "-20%", up: false,
note: "Down 20% this period", detail: "Acquisition needs attention")
SectionCard(label: "Active Accounts", value: "45,678", trend: "+12.5%",
note: "Strong user retention", detail: "Engagement exceed targets")
SectionCard(label: "Growth Rate", value: "4.5%", trend: "+4.5%",
note: "Steady performance increase", detail: "Meets growth projections")
}
Card("Total Visitors", description: "Total for the last 3 months") {
Chart(kind: .area,
series: [[186, 305, 237, 273, 209, 314, 280, 350, 302, 390, 360, 420],
[80, 200, 120, 190, 130, 140, 160, 210, 180, 230, 250, 270]],
labels: ["Apr 1", "Apr 15", "May 1", "May 15", "Jun 1", "Jun 15", "Jun 30"], height: 250)
} action: {
ToggleGroup(items: ["Last 3 months", "Last 30 days", "Last 7 days"], selection: "Last 3 months", variant: .outline)
}
Tabs(selection: "Outline") {
TabsContent("Outline") {
DataTable(columns: ["Header", "Section Type", "Status", TableHead("Target", alignment: .trailing),
TableHead("Limit", alignment: .trailing), "Reviewer", TableHead(" ", alignment: .trailing)],
rows: [
["Cover page", Badge("Cover page", variant: .outline), Badge("In Process", systemImage: "loader-circle", variant: .outline), 18, 5, "Eddie Lake", Button(systemImage: "ellipsis-vertical", variant: .ghost, size: .icon)],
["Table of contents", Badge("Table of contents", variant: .outline), Badge("Done", systemImage: "circle-check", variant: .outline), 29, 24, "Eddie Lake", Button(systemImage: "ellipsis-vertical", variant: .ghost, size: .icon)],
["Executive summary", Badge("Narrative", variant: .outline), Badge("Done", systemImage: "circle-check", variant: .outline), 10, 13, "Jamik Tashpulatov", Button(systemImage: "ellipsis-vertical", variant: .ghost, size: .icon)],
["Technical approach", Badge("Narrative", variant: .outline), Badge("In Process", systemImage: "loader-circle", variant: .outline), 27, 23, Select("Assign reviewer"), Button(systemImage: "ellipsis-vertical", variant: .ghost, size: .icon)]
],
selectedRows: [1]) {
} footer: {
Text("1 of 68 row(s) selected.")
Pagination(count: 7, page: 1)
}
}
TabsContent("Past Performance", badge: 3)
TabsContent("Key Personnel", badge: 2)
TabsContent("Focus Documents")
} trailing: {
Button("Customize Columns", systemImage: "columns", variant: .outline, size: .sm)
Button("Add Section", systemImage: "plus", variant: .outline, size: .sm)
}
}
.padding(24)
}
}
}