Skip to content
Klarhimmel UI

Card

Seaside suite

Two nights, breakfast included.

npx shadcn add @klarhimmel/card
DetailsAbout, 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.

card.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { Card } from '@/components/klarhimmel/ui/card';

export default function Example() {
  return (
    <Theme theme="brand">
      <Card className="p-6">…</Card>
    </Theme>
  );
}

Import

Import

import { Card } from '@/components/klarhimmel/ui/card';
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

PropTypeDefaultDescription
variant'flat' | 'raised' | 'sunken''flat'flat: hairline. raised: adds a shadow. sunken: filled, no border.
native attributesHTMLAttributes-Every native attribute of the element passes through, className included.

Accessibility

KeyDoes
TabSkips 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