Card

Displays a container with header, content, and footer.

Deploy to production
Your changes are ready to go live. Deploy them with one click.

Installation

pnpm dlx cubix@latest add card --base radix

Usage

Import
import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/cubix/card"
Example
<Card>
  <CardHeader>
    <CardTitle>Card title</CardTitle>
    <CardDescription>Card description</CardDescription>
  </CardHeader>
  <CardContent>...</CardContent>
  <CardFooter>...</CardFooter>
</Card>

Examples

With form

Cards pair naturally with Inputs and Buttons to build forms:

Create project
Deploy your new project in one-click.

With action

Use CardAction to add an action element (like a button) in the top-right corner of the header:

Notifications
You have 3 unread messages.

Your deployment finished successfully.

With icon

Compose the header with any element - an icon bubble draws attention to the title:

Pro plan
Unlock every component and priority support.

API Reference

Note: Every part renders a data-slot attribute (card, card-header, ...) for targeting in tests and parent selectors.

Card

The Card component displays a container with header, content, and footer.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).
...propsReact.ComponentProps<'div'>-All native div attributes (role, id, aria-*, ...) are forwarded to the rendered element.

CardHeader

Displays the card header. When a CardAction is present it switches to a two-column grid automatically.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

CardTitle

Displays the title of the card.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

CardDescription

Displays the description or content of the card header.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

CardAction

Displays an action element (like a button) positioned in the top-right corner of the header.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

CardContent

Displays the main content of the card.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).

CardFooter

Displays the footer of the card - ideal for actions.

PropTypeDefaultDescription
classNamestring-Additional Tailwind classes merged with the component styles (last one wins).