Card
Basic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { Card } from "@corew500/ui/card"
<Card>Content</Card>Variants
cardVariants
| Axis | Values | Default |
|---|---|---|
| variant | defaultoutline | default |
| size | defaultsm | default |
| interactive | truefalse | false |
| hoverIntent | defaultprimarysecondaryaccentdestructive | default |
cardContentVariants
| Axis | Values | Default |
|---|---|---|
| padding | defaultsmnone | default |
CMS Integration
Loading...
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| interactive | enum | false | Enables hover effects (shadow elevation, ring color transition, cursor pointer). Adds `group` class for child elements to use `group-hover:*` utilities. |
| hoverIntent | enum | default | Color intent for hover ring. Only applies when `interactive` is true. |
| render | (props: CardRenderProps) => ReactNode | — | Render function for custom element types (e.g., `<a>`, `<button>`). Receives props that must be spread onto the rendered element. @example ```tsx <Card interactive render={(props) => <a href="/details" {...props}>Content</a>} /> ``` |
| variant | enum | default | — |
| size | enum | default | — |
Accessibility
Keyboard Navigation
- `interactive` adds visual hover states only—not keyboard focus or click handling
- For clickable cards, wrap in `<a>` or `<button>`, or add `onClick` + `role="button"` + `tabIndex={0}`
Screen Readers
- - Uses semantic div elements; add role="region" with aria-label for landmark
- CardTitle should contain heading content for screen readers
Localization
Translatable Content
- - Pass translated strings to CardTitle and CardDescription
Additional
- CardContent accepts any localized content