Skip to content

Card

Groups related content and actions in one container.

Website refresh

Due October 18

Three of five tasks are complete. Review the homepage draft next.

card-basic-demo.tsx

Installation

The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.

Composition

  • Card
    • CardMediaOptional
    • CardHeader
      • CardTitle
        • CardLinkOptional

          Makes the whole card open the link.

      • CardDescription
      • CardActionOptional
    • CardContent
    • CardFooter

Action

CardAction sits beside the title and uses up to half the header width.

Notifications

3 unread messages

  • Amina Shah asked you to review the homepage.
  • Leo Park commented on the pricing draft.
  • Maya Chen added four images.
card-action-demo.tsx

Form

Wrap the content and footer in a Form so the footer button submits. Also install Form and Text field.

Studio North

Website refresh · Due October 18

card-demo.tsx

Media

Put CardMedia first or last. It follows the card corners. Also install Badge.

Quarterly growth report

Revenue grew in nine of the last ten weeks.

PublishedUpdated 2 days ago
card-media-demo.tsx

Linked card

Put CardLink in the title. The whole card opens the link. Give other buttons in the card relative z-10 so they stay clickable.

Installation

Add the CLI and your first component.

Themes

Change colors, radius, and fonts.

React Aria

Use the hooks and props under each part.

card-link-demo.tsx

API reference

CardTitle

as: "h1" | "h2" | "h3" | "h4" = "h3"
Heading level for the card title.