Card

Layout

A surface that groups related content: <Card.Root> holds an optional Card.Figure (an image that runs to the edges; inset pads it), a Card.Header (a Card.Title heading, at level 3 by default; a Card.Description; a Card.Action in the end corner), a Card.Content and a Card.Footer. variant: default (border and shadow), outline, dash (an empty or drop area), soft (a fill, no border). size: sm, default, lg (padding, gaps and title). layout: the figure above or below the text (vertical), beside it (horizontal, or responsive from the md breakpoint), or behind it with a scrim (overlay); beside or behind, the text goes in a Card.Body.

import { Card } from '@limerdev/zest';
Card for AI tools (llms.txt)
Use for
A block of a page about one thing: a customer's details, a summary figure, a settings section, an item in a grid, a product or article with its image.
Don't
Cards inside cards, or a card around a whole page: use spacing and Separator. A clickable card: put a link or button inside it instead of making the card the target.

Examples

Image

A figure that runs to the card's edges, a header with a badge, and actions.

Hills at sunset
Autumn retreat

14–16 October, Åre

Booked
Three days, 24 people. The invoice goes out on 1 October.

Header and actions

No figure: a header with a title, description and an action; content; a footer.

Acme AB

Customer since 2021

12 open invoices, 48 200 kr due.

Variants

variant: a border and shadow (default), a border only, a dashed border, a soft fill.

default

variant="default"

outline

variant="outline"

dash

variant="dash"

soft

variant="soft"

Sizes

size: the padding, the gaps and the title.

Size sm

size="sm"

Padding and gaps follow the size.
Size default

size="default"

Padding and gaps follow the size.
Size lg

size="lg"

Padding and gaps follow the size.

Side

layout="horizontal" puts the figure beside a Card.Body; "responsive" does so from md.

A lake below mountains
Lakeside office

Room for 12, from 1 March

Desks, two meeting rooms and a kitchen.
Green fields
Inset figure

Padded, with rounded corners; beside the text from md.

Overlay

layout="overlay": the figure is the background, with a scrim behind the text.

Spring kick-off

The whole company, 3 April

Figures

Summary figures in a grid of small cards: only a header and content.

Invoiced

+12%
312 400 kr

Paid

+8%
264 900 kr

Overdue

−4%
18 300 kr

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

Card.Root

Prop Type Default Description
layout "horizontal" | "vertical" | "responsive" | "overlay" 'vertical' Where a Card.Figure goes: above or below the text (vertical), beside it (horizontal), beside it from the md breakpoint (responsive), or behind it as the background (overlay). Beside or behind, put the text in a Card.Body.
size "default" | "sm" | "lg" 'default' The padding, the gaps and the title's size.
variant "outline" | "default" | "dash" | "soft" 'default' The look: a border and a shadow (default), a border only (outline), a dashed border (dash, for an empty or drop area), or a soft fill without a border (soft).

Card.Figure

Prop Type Default Description
inset boolean false Pad the figure and round the image, instead of running it to the card's edges.

Card.Body

No props of its own beyond the common ones.

Card.Header

No props of its own beyond the common ones.

Card.Title

Prop Type Default Description
level 1 | 2 | 3 | 4 | 5 | 6 3 The heading level, for the page's outline.

Card.Description

No props of its own beyond the common ones.

Card.Action

No props of its own beyond the common ones.

Card.Content

No props of its own beyond the common ones.

Card.Footer

No props of its own beyond the common ones.