Card
Container for grouping related content.
import { Card } from "@ninna-ui/data-display"pnpm add @ninna-ui/data-displayRequires @ninna-ui/core (auto-installed) + CSS setup.
Usage
Import and use the Card component in your application.
import { Card } from "@ninna-ui/data-display";import { Button } from "@ninna-ui/primitives";
export default function Example() { return ( <Card> <Card.Header> <Card.Title>Title</Card.Title> <Card.Description>Description</Card.Description> </Card.Header> <Card.Body>Content here</Card.Body> <Card.Footer> <Button size="sm">Action</Button> </Card.Footer> </Card> );}Basic
A basic card with header, body, and footer.
Card Title
A brief description of the card content.
This is a basic card with header, body, and footer sections.
Variants
Card supports outline, elevated, soft, solid, and ghost styles.
outline
Card variant
Content for outline variant.
elevated
Card variant
Content for elevated variant.
filled
Card variant
Content for filled variant.
ghost
Card variant
Content for ghost variant.
Colors
Card can be themed with predefined brand and semantic colors.
outline Variant
NEUTRAL
Example of a outline card using the neutral theme color.
PRIMARY
Example of a outline card using the primary theme color.
SECONDARY
Example of a outline card using the secondary theme color.
ACCENT
Example of a outline card using the accent theme color.
SUCCESS
Example of a outline card using the success theme color.
DANGER
Example of a outline card using the danger theme color.
WARNING
Example of a outline card using the warning theme color.
INFO
Example of a outline card using the info theme color.
soft Variant
NEUTRAL
Example of a soft card using the neutral theme color.
PRIMARY
Example of a soft card using the primary theme color.
SECONDARY
Example of a soft card using the secondary theme color.
ACCENT
Example of a soft card using the accent theme color.
SUCCESS
Example of a soft card using the success theme color.
DANGER
Example of a soft card using the danger theme color.
WARNING
Example of a soft card using the warning theme color.
INFO
Example of a soft card using the info theme color.
solid Variant
NEUTRAL
Example of a solid card using the neutral theme color.
PRIMARY
Example of a solid card using the primary theme color.
SECONDARY
Example of a solid card using the secondary theme color.
ACCENT
Example of a solid card using the accent theme color.
SUCCESS
Example of a solid card using the success theme color.
DANGER
Example of a solid card using the danger theme color.
WARNING
Example of a solid card using the warning theme color.
INFO
Example of a solid card using the info theme color.
elevated Variant
NEUTRAL
Example of a elevated card using the neutral theme color.
PRIMARY
Example of a elevated card using the primary theme color.
SECONDARY
Example of a elevated card using the secondary theme color.
ACCENT
Example of a elevated card using the accent theme color.
SUCCESS
Example of a elevated card using the success theme color.
DANGER
Example of a elevated card using the danger theme color.
WARNING
Example of a elevated card using the warning theme color.
INFO
Example of a elevated card using the info theme color.
Interactive
Cards with hover and focus styles for clickable use cases.
Clickable
Hover to see the effect.
Static
No hover effect.
API Reference
Complete list of props for the Card component and its sub-components.
Card (Root)
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'outline' | 'elevated' | 'filled' | 'ghost' | 'soft' | 'solid' | 'outline' | Visual style variant |
color | 'primary' | 'secondary' | 'accent' | 'neutral' | 'success' | 'danger' | 'warning' | 'info' | - | Color theme of the card |
interactive | boolean | false | Enable hover and focus styles for clickable cards |
className | string | - | Additional CSS classes |
Card.Header
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional CSS classes |
Card.Title
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Additional CSS classes |
Accessibility
- Card uses semantic HTML with proper heading hierarchy
- Interactive cards receive focus styles and are keyboard navigable
- Card content is read naturally by screen readers