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).
| Prop | Type | Default | Description |
|---|---|---|---|
variant | CardVariantCardVariant = 'default' | 'outline' | 'elevated' | 'ghost' | 'filled' | 'default' | |
sizing | CardSizeCardSize = 'default' | 'sm' | 'default' | |
interactive | boolean | false | Hover / pressed feedback + focusable (use when the whole card is clickable). |
image | ResourceStr | undefined | undefined | Full-bleed media header. |
imageHeight | number | undefined | undefined | Height of the media header in vp; defaults to a 16:9 box. |
modifier | AttributeModifier<ColumnAttribute> | new SparkNoopModifier<ColumnAttribute>() | |
tokens | CardTokens | {} | 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
| Prop | Type | Default | Description |
|---|---|---|---|
text | ResourceStr | '' |
SCardDescription
| Prop | Type | Default | Description |
|---|---|---|---|
text | ResourceStr | '' |
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)