A surface container with configurable padding and an optional header (icon + title + an `action` slot).

pnpm add @behivetech/atoms.card

You are viewing Card v0.6.0, snapshotted 2026-11-09. The latest is v0.6.2. Go to the latest →

Examples of v0.6.0 are shown as code; only the latest version runs live. Open the live examples →

Default Card
1const DefaultCard = () => (
2 <Card padding="md">Default card with md padding</Card>
3);
4
5render(<DefaultCard />);
No Padding Card
1const NoPaddingCard = () => (
2 <Card padding="none">Card with no padding</Card>
3);
4
5render(<NoPaddingCard />);
Small Padding Card
1const SmallPaddingCard = () => (
2 <Card padding="sm">Card with sm padding</Card>
3);
4
5render(<SmallPaddingCard />);
Large Padding Card
1const LargePaddingCard = () => (
2 <Card padding="lg">Card with lg padding</Card>
3);
4
5render(<LargePaddingCard />);
Card With Header
1const CardWithHeader = () => (
2 <Card title="Settings" padding="md">
3 Card body content
4 </Card>
5);
6
7render(<CardWithHeader />);
Card With Icon And Action
1const CardWithIconAndAction = () => (
2 <Card
3 icon="🧩"
4 title="Block"
5 action={<button onClick={() => {}}>✕</button>}
6 padding="md"
7 >
8 Card body content
9 </Card>
10);
11
12render(<CardWithIconAndAction />);
Interactive Card
1const InteractiveCard = () => (
2 <Card padding="md" onSelect={() => {}}>
3 <span>🧩</span>
4 <span>Click me</span>
5 </Card>
6);
7
8render(<InteractiveCard />);
Card As Page Level Section
1const CardAsPageLevelSection = () => (
2 <Card title="Settings" headingLevel={2} padding="md">
3 Used directly under a page&rsquo;s h1, with no intervening section — its
4 title takes the h2 slot instead of the h3 default.
5 </Card>
6);
7
8render(<CardAsPageLevelSection />);