- Accordion
- Alert
- Alert Dialog
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Date Picker
- Dialog
- DrawerNew
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Meter
- Number Field
- OTP FieldNew
- Pagination
- Popover
- Preview Card
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Toolbar
- Tooltip
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,
CardDescription,
CardFooter,
CardHeader,
CardPanel,
CardTitle,
} from "@/components/ui/card";
import { Field, FieldLabel } from "@/components/ui/field";
import { Form } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import {
Select,
SelectItem,
SelectPopup,
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>
<CardPanel>
<Form>
<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>
<SelectPopup>
{frameworkOptions.map(({ label, value }) => (
<SelectItem key={value} value={value}>
{label}
</SelectItem>
))}
</SelectPopup>
</Select>
</Field>
<Button className="w-full" type="submit">
Deploy
</Button>
</Form>
</CardPanel>
<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 @coss/card
Usage
import {
Card,
CardDescription,
CardFooter,
CardHeader,
CardPanel,
CardTitle,
} from "@/components/ui/card"<Card>
<CardHeader>
<CardTitle>Title</CardTitle>
<CardDescription>Description</CardDescription>
</CardHeader>
<CardPanel>Content</CardPanel>
<CardFooter>Footer</CardFooter>
</Card>CardFrame with header action
Use CardFrame when you need a framed layout with an action button in the header (e.g. "Add", "Connect"):
import {
CardFrame,
CardFrameAction,
CardFrameDescription,
CardFrameHeader,
CardFrameTitle,
CardPanel,
} from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { PlusIcon } from "lucide-react"
<CardFrame>
<CardFrameHeader>
<CardFrameTitle>Project</CardFrameTitle>
<CardFrameDescription>
Manage your project settings and configuration
</CardFrameDescription>
<CardFrameAction>
<Button variant="outline">
<PlusIcon />
Add
</Button>
</CardFrameAction>
</CardFrameHeader>
<Card>
<CardPanel>Content</CardPanel>
</Card>
</CardFrame>CardFrame with a table
For lists or data grids, render a Table with variant="card" inside CardFrame so the grid matches the frame’s border and radius. See the CardFrame example in the Table docs. Add @coss/table if it is not already in the project.
API Reference
This is a custom component using Base UI's useRender hook, not a direct Base UI wrapper.
Card
Root container for the card. Supports the render prop.
| Prop | Type | Default | Description |
|---|---|---|---|
render | React.ReactElement | - | Render as a different element |
CardHeader
Header section container. Supports the render prop.
CardTitle
Title text for the card. Supports the render prop.
CardDescription
Description text for the card. Supports the render prop.
CardAction
Container for action buttons in the header. Automatically positions to the right. Supports the render prop.
CardPanel
Main content area of the card. Also exported as CardContent. Supports the render prop.
CardFooter
Footer section for the card. Supports the render prop.
CardFrame API Reference
CardFrame is an alternative layout for cards that groups a header, content, and footer with consistent styling and clipping. Use it when you need a framed card with optional header actions.
CardFrame
Root container for the framed card layout. Supports the render prop.
CardFrameHeader
Header section for the frame. Contains title, description, and optionally CardFrameAction. Supports the render prop.
CardFrameTitle
Title text for the frame. Supports the render prop.
CardFrameDescription
Description text for the frame. Supports the render prop.
CardFrameAction
Container for action buttons (e.g. "Add", "Edit") in the header. Place it as a sibling of CardFrameTitle and CardFrameDescription inside CardFrameHeader. It is positioned in the top-right via CSS grid (col-start-2, row-span-2, self-center, justify-self-end). Use it for primary actions that apply to the entire frame. Supports the render prop.
CardFrameFooter
Footer section for the frame. Supports the render prop.