With action
Place one secondary action in the card header. CardAction moves the header into two columns; the title is exposed as a heading through role and aria-level. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.
"use client"
import { Button } from "@/components/ui/button"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
export function CardWithAction() {
return (
<div className="flex w-full max-w-2xl flex-col gap-8">
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle role="heading" aria-level={3}>
Storage
</CardTitle>
<CardDescription>8.2 GB of 10 GB used on the team plan.</CardDescription>
<CardAction>
<Button size="xs" intent="neutral" emphasis="stroke">
Manage storage
</Button>
</CardAction>
</CardHeader>
<CardContent>
<p className="text-paragraph-sm text-sub-600">
Files older than 90 days in the archive folder can be removed to free
about 1.4 GB.
</p>
</CardContent>
</Card>
</div>
)
}