HextaUI

Card: Nested

A card inside CardContent derives its radius from the parent’s radius minus the spacing, so the corners stay concentric.

Usage
This billing period.
Build minutes
1,240 of 3,000 used
84 GB of 100 GB used
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardLink,
  CardTitle,
} from "@/components/ui/card"

export function CardNested() {
  return (
    <Card className="w-full max-w-sm">
      <CardHeader>
        <CardTitle>Usage</CardTitle>
        <CardDescription>This billing period.</CardDescription>
      </CardHeader>
      <CardContent>
        <Card variant="muted" size="sm">
          <CardHeader>
            <CardTitle>Build minutes</CardTitle>
            <CardDescription>1,240 of 3,000 used</CardDescription>
          </CardHeader>
        </Card>
        <Card variant="outline" size="sm">
          <CardHeader>
            <CardTitle>
              <CardLink href="#">Bandwidth</CardLink>
            </CardTitle>
            <CardDescription>84 GB of 100 GB used</CardDescription>
          </CardHeader>
        </Card>
      </CardContent>
    </Card>
  )
}

This adds the example as components/examples/card/nested.tsx, together with the Card component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/card-nested.json

To add only the component, follow the Card installation.

Props in this example

The Card props this example sets, from the API reference.

PropTypeDefault
variant
"default" | "outline" | "muted""default"
sizeScales spacing, radius and title size together.
"default" | "sm" | "flush""default"
PropTypeDefault
href
string–

Every prop is in the Card API reference.

See them all, with keyboard support and accessibility notes, on the Card page.