Card
A versatile container component with glassmorphism support, perfect for grouping related content.
Import
tsx
import { ZCard } from "@zurto/ui";Basic Usage
Card Title
Card content goes here.
Variants
Default
Default card with solid background
Glass
Glassmorphism effect with blur backdrop
Elevated
Elevated card with shadow
Interactive Cards
Clickable Card
Hover and click me
With Header and Footer
Settings
Manage your preferences
Configure your account settings here.
Card Grid
Card 1
Card 2
Card 3
Card with Image
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'glass' | 'bordered' | 'elevated' | 'default' | Visual style of the card |
padding | 'none' | 'sm' | 'md' | 'lg' | 'md' | Internal padding size |
interactive | boolean | false | Enable hover and click effects |
onClick | () => void | – | Click handler (makes card interactive) |
as | ElementType | 'div' | Render as different element |
childrenRequired | ReactNode | – | Card content |
Compound Components
| Component | Description |
|---|---|
ZCard | Main container |
ZCardHeader | Header section with title and subtitle |
ZCardTitle | Title element |
ZCardSubtitle | Subtitle/description element |
ZCardBody | Main content area |
ZCardFooter | Footer with actions |
Accessibility
- Uses semantic HTML structure
- Interactive cards are keyboard focusable
role="button"applied when clickable- Supports
aria-labelfor screen readers
Keyboard Support
| Key | Action |
|---|---|
Tab | Move focus to interactive card |
Enter / Space | Activate interactive card |