Skip to content

Card ​

Displays a card with header, content, and footer. Padding tightens automatically when the card is narrow.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Variants ​

variant: default | outline | elevated | filled | ghost; sizing: 'sm'.

Approximate web preview — the HarmonyOS rendering is the reference.

Interactive & media ​

interactive adds hover / pressed feedback; image puts a full-bleed header on top.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SCard ​

shadcn-vue Card: bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm. Responsive without breakpoints: padding tightens automatically when the card itself is narrow.

Variants: default | outline (border only) | elevated (shadow-md, no border) | ghost (no surface) | filled (bg-muted). sizing: 'sm' keeps the compact 16vp padding. interactive adds hover / pressed feedback and focusability — attach the action on a wrapping Stack() { SCard(...) { ... } }.onClick(...) (slot components cannot chain events). image puts a full-bleed media header on top (imageHeight, default 16:9).

PropTypeDefaultDescription
variantCardVariant
CardVariant = 'default' | 'outline' | 'elevated' | 'ghost' | 'filled'
'default'
sizingCardSize
CardSize = 'default' | 'sm'
'default'
interactivebooleanfalseHover / pressed feedback + focusable (use when the whole card is clickable).
imageResourceStr | undefinedundefinedFull-bleed media header.
imageHeightnumber | undefinedundefinedHeight of the media header in vp; defaults to a 16:9 box.
modifierAttributeModifier<ColumnAttribute>new SparkNoopModifier<ColumnAttribute>()
tokensCardTokens{}Per-instance token overrides (instance → theme --card-* → recipe), see {@link CardTokens}.

Slots: children (trailing closure)

SCardHeader ​

Title + description (+ optional SCardAction on the right).

Slots: children (trailing closure)

SCardTitle ​

PropTypeDefaultDescription
textResourceStr''

SCardDescription ​

PropTypeDefaultDescription
textResourceStr''

SCardAction ​

Header action placed at the top-right corner of the card.

Slots: children (trailing closure)

SCardContent ​

Slots: children (trailing closure)

SCardFooter ​

Actions row; wraps onto several lines when the card is narrow.

Slots: children (trailing closure)

MIT Licensed