Skip to content
Data Display

Card

server34.25 kB
@stellaria/nebula-webCardProps

Preview

Props

13
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

—

gradientBorder

Draws a gradient ring around the card, without a wrapper in the consumer's markup. `<GradientBorder><Card /></GradientBorder>` is the pattern this replaces, and the wrapper had a trap in it: the ring's corner radius and the card's had to be kept in step by hand, and they drift the moment one of the two changes. Here the ring takes the card's `r`. `true` takes the brand gradient. A role name or a literal `{ from, to }` picks the gradient. An object configures the ring — `beam` sends the travelling arc round it.

boolean | { from: ColorExtended; to: ColorExtended; deg?: number; animate?: boolean; } | GradientRole | CardGradientBorder

—

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)

—

reveal

Animates the card in when it first scrolls into view. `true` takes the catalogue entrance; an object tunes it. It is declared here and forwarded to the root `Box` rather than inherited: `reveal` lives on `BoxOwnProps`, and `Card` — like most of the catalogue — types its props over `StyleProps`, so nothing arrives on its own.

boolean | UseRevealOptions

—

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