Card
A flexible container component for grouping related content with optional header, footer, and content sections.
Basic Usage
Examples
Basic Card
A simple card with just content.
This is a basic card with just content. Perfect for simple layouts where you only need a container with consistent styling.
Card with Header
Card with a title and description in the header.
Card Title
This card has a header with a title and description. Great for introducing content sections.
Your main content goes here. The header provides clear context for what this card contains.
Card with Footer
Card with action buttons in the footer.
This card includes a footer section with actions. The footer has a border separator and consistent spacing.
Complete Card
Card with header, content, and footer sections.
Complete Card Example
This card demonstrates all components working together: header, content, and footer.
This is the main content area where you can place any content you need.
Metric Card
Specialized card for displaying metrics with MetricCardTitle.
Total API Calls
1,234,567
Card Grid
Multiple cards in a responsive grid layout.
API Keys
Manage your API keys
Create and manage API keys for your applications.
Analytics
View usage analytics
45.2K
99.9%
Settings
Configure your workspace
Update your workspace settings and preferences.
Components
The Card system is composed of several subcomponents:
- Card: The main container
- CardHeader: Container for title and description
- CardTitle: Main heading text (h2 element)
- MetricCardTitle: Title specifically for metrics (p element)
- CardDescription: Subtitle or description text
- CardContent: Main content area
- CardFooter: Footer area with border separator
Props
Card
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Card content |
CardHeader
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Header content |
CardTitle
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Title text |
MetricCardTitle
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Metric title text |
CardDescription
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Description text |
CardContent
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Main content |
CardFooter
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Additional CSS classes |
children | React.ReactNode | undefined | Footer content |
Features
- Composable architecture for flexible layouts
- Consistent styling with design system
- Built-in spacing and typography
- Responsive design
- Border and background styling
- Accessible semantic structure
Best Practices
- Use
CardTitle
for main headings andMetricCardTitle
for numeric metrics - Include
CardDescription
to provide context for the card content - Use
CardFooter
for actions or additional information - Combine components based on your content needs
- Apply consistent spacing using the default padding
Accessibility
- Uses semantic HTML elements (h2 for CardTitle, p for descriptions)
- Maintains proper heading hierarchy
- Provides sufficient color contrast
- Supports keyboard navigation
- Screen reader friendly structure