Card

A bordered surface for related content and actions.

Preview

Workspace access

Design Operations
Private
Members
12
Pending invitations
2

Installation

pnpm dlx shadcn@latest add https://migoy.stanleyaf.com/r/card.json

Card uses your existing theme and cn utility. Install Button separately to use the preview as written.

Usage

import { Card, CardContent } from '@/components/ui/card';

<Card>
  <CardContent>Next invoice due December 1.</CardContent>
</Card>

Composition

Card
├── CardHeader
│   ├── CardTitle
│   ├── CardDescription
│   └── CardAction
├── CardContent
└── CardFooter

Use Card with CardContent for a simple body. Add CardHeader for a title or description. Place CardAction directly inside the header to align it beside the title. Use CardFooter for actions or supporting information below the body.

Background

Set className on an individual card to override its surface. Use bg-background text-foreground to match the page canvas in both themes.

Billing contact

Invoices are sent to finance@example.com.

Accessibility

Put a heading inside CardTitle when the card introduces a section. Choose the heading level from the page hierarchy. Keep the card surface out of the tab order and use native links for navigation or buttons for actions. Tab moves between those controls in document order.

API

Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, and CardFooter each render a div and accept standard div props.

PropTypePurpose
childrenReact.ReactNodeNested Card parts or content
classNamestringAdd layout utilities or a divider with border-b on the header or border-t on the footer
refReact.Ref<HTMLDivElement>Access the rendered element

The slot structure follows shadcn Card. Migoy uses its own surface tokens and a single spacing treatment.

On this page