Card
A macOS box: a rounded panel with a hairline edge, a header, content and a footer.
@cupertinoui/cardRegistry JSON import { Button } from "@/components/ui/button"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Progress } from "@/components/ui/progress"
export default function CardDemo() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle>iCloud+</CardTitle>
<CardDescription>200 GB plan, shared with your family</CardDescription>
<CardAction>
<Button variant="secondary" size="sm">Manage…</Button>
</CardAction>
</CardHeader>
<CardContent className="flex flex-col gap-2">
<Progress value={64} />
<div className="flex justify-between text-mac-subheadline text-mac-label-secondary">
<span>128,4 GB used</span>
<span>71,6 GB free</span>
</div>
</CardContent>
<CardFooter className="justify-end">
<Button size="sm">Upgrade</Button>
</CardFooter>
</Card>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/cardThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
<Card>
<CardHeader>
<CardTitle>iCloud+</CardTitle>
<CardDescription>200 GB plan</CardDescription>
</CardHeader>
<CardContent>…</CardContent>
</Card>API Reference
Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.
Card
| Prop | Type | Description |
|---|---|---|
size | "default" | "sm"Default: "default" | 16 or 12pt of padding. |
className | string | Extra classes, merged with the component's own. |
CardHeader / CardTitle / CardDescription / CardAction / CardContent / CardFooter
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |