HextaUI

Card: Variants

default sits on a hairline ring with a soft shadow, outline drops the fill and shadow, and muted uses a filled surface for quieter sections.

Default
Hairline ring and a soft shadow.
Outline
Ring only, no fill, no shadow.
Muted
Filled surface for quiet sections.
import {
  Card,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

export function CardVariants() {
  return (
    <div className="grid w-full gap-4 sm:grid-cols-3">
      <Card>
        <CardHeader>
          <CardTitle>Default</CardTitle>
          <CardDescription>Hairline ring and a soft shadow.</CardDescription>
        </CardHeader>
      </Card>
      <Card variant="outline">
        <CardHeader>
          <CardTitle>Outline</CardTitle>
          <CardDescription>Ring only, no fill, no shadow.</CardDescription>
        </CardHeader>
      </Card>
      <Card variant="muted">
        <CardHeader>
          <CardTitle>Muted</CardTitle>
          <CardDescription>Filled surface for quiet sections.</CardDescription>
        </CardHeader>
      </Card>
    </div>
  )
}

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

pnpm dlx shadcn@latest add https://hextaui.com/r/card-variants.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"

Every prop is in the Card API reference.

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