Card
Seaside suite
Two nights, breakfast included.
npx shadcn add @klarhimmel/cardCopy for AIDetailsAbout, usage, props and more
A surface that groups related content: flat, raised or sunken.
When to use
Use for
One thing people scan as a unit.
Not for
Layout alone. Do not nest cards.
Pairs with
Badge, Button, Text link.
Preview
New
Weekly summary
What shipped, what slipped and what is next, every Monday.
Import
Import
- Files
- card.tsx, in components/klarhimmel/ui/. With it: theme, utils.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'flat' | 'raised' | 'sunken' | 'flat' | flat: hairline. raised: adds a shadow. sunken: filled, no border. |
native attributes | HTMLAttributes | - | Every native attribute of the element passes through, className included. |
Accessibility
| Key | Does |
|---|---|
Tab | Skips the card itself; moves to buttons and links inside |
A card is a plain container. Make one thing in it the link or button, not the whole card.
Accessibility