Skip to content

Item ​

A versatile row for lists and settings: media, title, description and actions. When an item is narrower than 360vp its actions wrap under the text.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Settings group ​

SItemGroup({ bordered, separators }) turns rows into a settings card: flush rows, inset hairlines, tinted icon tiles and pressed feedback on interactive rows.

Approximate web preview — the HarmonyOS rendering is the reference.

Image & avatar media ​

Approximate web preview — the HarmonyOS rendering is the reference.

Narrow ​

Below 360vp the actions move to their own line under the text.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

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

SItemGroup ​

shadcn-vue ItemGroup: a vertical list of SItem. bordered turns it into a settings-style card (bg-card border, rounded-xl, items flush and clipped); separators draws a hairline between items automatically (inset to the text column when insetSeparators).

PropTypeDefaultDescription
borderedbooleanfalse
separatorsbooleanfalse
insetSeparatorsbooleantrue
spacingnumber0vertical gap between items in vp (shadcn ItemGroup has none; outline items often use 16)
modifierAttributeModifier<ColumnAttribute>new SparkNoopModifier<ColumnAttribute>()

Slots: children (trailing closure)

SItem ​

shadcn-vue Item: flex flex-wrap items-center gap-4 rounded-md border border-transparent p-4 text-sm (sm: gap-2.5 px-4 py-3). Variants: default (transparent), outline (border-border), muted (bg-muted/50).

interactive adds hover (bg-accent/50) and pressed (bg-accent) feedback and focusability; attach the action with a wrapping Stack() { SItem(...) { ... } }.onClick(...) (slot components cannot chain events).

Responsive: when the item itself is narrower than 360vp, SItemActions wraps onto its own line under the text.

PropTypeDefaultDescription
variantItemVariant
ItemVariant = 'default' | 'outline' | 'muted'
'default'
sizingItemSize
ItemSize = 'default' | 'sm'
'default'
interactivebooleanfalsehover / pressed feedback + focusable (use when the row is clickable)
modifierAttributeModifier<FlexAttribute>new SparkNoopModifier<FlexAttribute>()

Slots: children (trailing closure)

SItemSeparator ​

Separator between items when not using SItemGroup({ separators: true }).

No props.

SItemMedia ​

ItemMedia: default (bare icon / avatar, 20vp icon), icon (size-8 rounded-sm border bg-muted, 16vp icon) or image (size-10 rounded-sm overflow-hidden, object-cover src). Aligns to the top when the item has a description.

tint (an #AARRGGBB token such as theme.colors.chart2) gives the icon variant a soft coloured tile — handy for settings lists.

PropTypeDefaultDescription
iconstring | undefinedundefined
variantItemMediaVariant
ItemMediaVariant = 'default' | 'icon' | 'image'
'default'
srcResourceStr | undefinedundefinedimage for the image variant
tintstring | undefinedundefined

Slots: children (trailing closure)

SItemContent ​

flex flex-1 flex-col gap-1: title + description.

Slots: children (trailing closure)

SItemTitle ​

flex w-fit items-center gap-2 text-sm leading-snug font-medium; the slot holds trailing badges.

PropTypeDefaultDescription
textResourceStr''

Slots: children (trailing closure)

SItemDescription ​

text-muted-foreground line-clamp-2 text-sm leading-normal.

PropTypeDefaultDescription
textResourceStr''
maxLineCountnumber2line clamp (shadcn: 2)

SItemActions ​

flex items-center gap-2, trailing; wraps under the text (aligned with it) when the item is narrow.

Slots: children (trailing closure)

MIT Licensed