Server Component · 0 KB client JS

Card

A content container with header, body and footer sections in four variants.

Production cluster

us-east-1 · 12 nodes

Operational

All services healthy. Last incident 42 days ago.

Import#

import { Card } from "astralis-ui";
// Card.Header, .Title, .Description, .Body, .Footer

Anatomy#

Card.Header takes an extra slot for trailing content (badges, menus); size on the root scales every section's padding: the root stamps it as a data-card-size attribute and the sections' CSS reads it, so the whole compound stays a Server Component.

Variants#

hoverable adds a lift on hover. Pair it with clickable cards.

elevated

hoverable: try me

outline

hoverable: try me

filled

hoverable: try me

Props#

PropTypeDefaultDescription
variant"elevated" | "outline" | "filled" | "unstyled""elevated"Shadowed, bordered, tinted, or bare.
size"sm" | "md" | "lg""md"Padding density for all sections.
hoverablebooleanfalseHover elevation.

Card takes no style props: those belong to the layout primitives. Sizing and placement are the job of whatever lays the card out: a Grid with alignItems="stretch" already gives a row of cards equal heights, and anything past that goes on a wrapping Box.

Card.Header additionally takes extra: ReactNode; Card.Title renders an h3 and Card.Description a p. Both accept their native attributes.