- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Card
A content container for grouping related information.
This will take a few seconds to complete.
import { CircleAlertIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Field, FieldLabel } from "@/components/ui/field";
import { Input } from "@/components/ui/input";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
const frameworkOptions = [
{ label: "Next.js", value: "next" },
{ label: "Vite", value: "vite" },
{ label: "Remix", value: "remix" },
{ label: "Astro", value: "astro" },
];
export default function Particle() {
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle>Create project</CardTitle>
<CardDescription>Deploy your new project in one-click.</CardDescription>
</CardHeader>
<CardContent>
<form className="flex w-full flex-col gap-4">
<Field>
<FieldLabel>Name</FieldLabel>
<Input placeholder="Name of your project" type="text" />
</Field>
<Field>
<FieldLabel>Framework</FieldLabel>
<Select defaultValue="next" items={frameworkOptions}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
{frameworkOptions.map(({ label, value }) => (
<SelectItem key={value} value={value}>
{label}
</SelectItem>
))}
</SelectContent>
</Select>
</Field>
<Button className="w-full" type="submit">
Deploy
</Button>
</form>
</CardContent>
<CardFooter>
<div className="flex gap-1 text-muted-foreground text-xs">
<CircleAlertIcon className="size-3 h-lh shrink-0" />
<p>This will take a few seconds to complete.</p>
</div>
</CardFooter>
</Card>
);
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/card
Usage
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";<Card>
<CardHeader>
<CardTitle>Title</CardTitle>
<CardDescription>Description</CardDescription>
</CardHeader>
<CardContent>Content</CardContent>
<CardFooter>Footer</CardFooter>
</Card>With a header action
Use CardAction when you need an action button in the header (e.g. "Add", "Connect"). Place it as a sibling of CardTitle and CardDescription inside CardHeader:
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { PlusIcon } from "lucide-react";
<Card>
<CardHeader>
<CardTitle>Project</CardTitle>
<CardDescription>Manage your project settings and configuration</CardDescription>
<CardAction>
<Button variant="outline">
<PlusIcon aria-hidden="true" />
Add
</Button>
</CardAction>
</CardHeader>
<CardContent>Content</CardContent>
</Card>;Framed layouts
For a framed container that clips its content to the border and radius — for example around a Table — use the Frame component instead of Card.
API Reference
Card is a set of styled div elements, not a Base UI wrapper. Every part accepts the standard div props.
Card
Root container for the card.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "default" | Visual size of the card |
CardHeader
Header section container. Switches to a two-column grid when it contains a CardAction.
CardTitle
Title text for the card.
CardDescription
Description text for the card.
CardAction
Container for action buttons in the header. Positioned in the top-right via CSS grid (col-start-2, row-span-2, justify-self-end). Place it inside CardHeader.
CardContent
Main content area of the card.
CardFooter
Footer section for the card.