Card
@/components/kamod-ui/card
Installation
Import Card and subcomponents from `@/components/kamod-ui/card`.
pnpm add @kamod-ch/uiUsage
Compose `CardHeader` (title, description, optional `CardAction`), `CardContent`, and `CardFooter`. Set `size="sm"` on `Card` for tighter padding. For cover images, use `class="pt-0"` on the card and place the image as the first block; pair with `DirectionProvider` for RTL layouts.
import { Card } from "@/components/kamod-ui/card";<Card />Demo
Login-style layout with header action, form fields, and stacked footer buttons (shadcn CardDemo).
Size
Use `size="sm"` for reduced vertical padding and smaller type scale on the card.
Image
Hero image with overlay, badge action in the header, and a full-width primary button (shadcn CardImage).
API Reference
Props, slots and variants for this component.
Card
Card component props and accepted values.
| Prop | Type | Default |
|---|---|---|
| Card `size` | `"default"` | `"sm"` | `"default"` |
| Card `class` | string | undefined |
| CardHeader `class` | string | undefined |
| CardTitle `class` | string | undefined |
| CardDescription `class` | string | undefined |
| CardAction `class` | string | undefined |
| CardContent `class` | string | undefined |
| CardFooter `class` | string | undefined |
Accessibility Notes
Keep headings concise; ensure `CardAction` controls have visible labels. When using image cards, provide meaningful `alt` text. For RTL, set `dir` on the card and wrap with `DirectionProvider` so spacing utilities resolve correctly.