Skip to content
Data Display

Card

client33.5 kB
@stellaria/nebula-webCardProps

Preview

Props

12
PropTypeDefault

aria-label

Names the card. An actionable card needs it whenever its content does not already say where it leads, since everything inside is read as one long link name otherwise.

string

children

required

The card's content, usually assembled from its parts.

ReactNode

className

string

color

The scale the variant draws from. Only read when there is a `variant`.

ColorExtended"primary"

glass

Glass step when `variant="glass"`. `subtle` by default (ADR-078).

GlassLevel

href

Makes the whole card an anchor. It wins the root element over `onPress`, and it is what lets a card be opened in a new tab — a card built on `onPress` cannot be.

string

interactive

Whether the card lifts on hover and gives on press. Left out it decides for itself, turning on as soon as there is an `onPress` or an `href`; set it by hand only to lift a card that does nothing, or to still one that does.

boolean

onPress

Makes the whole card a `button` and runs on press. `href` beats it: with both, the card is an anchor and this never fires.

(() => void)

padding

Inner padding. `"none"` is for a card whose parts bring their own — an edge-to-edge image, a section with its own inset.

"md" | "lg" | "xl" | "none""lg"

shadow

Depth of the drop shadow. Flat by default because a grid of raised cards reads as noise; lift the one card that has to come forward, not all of them.

"none" | ShadowLevel"none"

variant

How the surface is filled. Leaving it out is a real choice, not a missing one: the card then resolves no variant at all and keeps the plain surface, which is what most cards want. With it left out, `color` and `glass` are read by nothing.

CardVariant

withBorder

Whether the hairline is drawn. Turning it off is not always enough: a variant that resolves a border of its own puts it back, because the fill needs the edge to sit against.

booleantrue

Parts

5
Card.ActionsCard.BadgesCard.ImageCard.MetaCard.Section

Also accepts

On top of its own props, this component forwards these groups.

HTML attributes · 275Style props · 127