Skip to content

Empty ​

Use the Empty component to display an empty state. Padding grows from 24 to 48vp when the component itself is wider than 480vp.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Avatar media ​

Approximate web preview — the HarmonyOS rendering is the reference.

Filled & compact ​

filled: bg-muted/50 surface; compact: 16vp padding for small containers.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

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

SEmpty ​

shadcn-vue Empty: flex flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 md:p-12 text-center. Padding follows the component's own width (24vp below 480vp, 48vp above); bordered draws the dashed outline.

Variants: bordered (dashed outline), filled (bg-muted/50 surface) and compact (16vp padding, 16vp gaps — for empty states inside cards, lists or popovers).

PropTypeDefaultDescription
borderedbooleanfalse
filledbooleanfalseMuted surface (bg-muted/50).
compactbooleanfalseTight spacing for small containers.
modifierAttributeModifier<ColumnAttribute>new SparkNoopModifier<ColumnAttribute>()

Slots: children (trailing closure)

SEmptyHeader ​

flex max-w-sm flex-col items-center gap-2 text-center.

Slots: children (trailing closure)

SEmptyMedia ​

mb-2 flex shrink-0 items-center justify-center; the icon variant is bg-muted size-10 rounded-lg with a 24vp icon. Put avatars or images in the slot with the default variant.

PropTypeDefaultDescription
iconstring | undefinedundefined
variantEmptyMediaVariant
EmptyMediaVariant = 'default' | 'icon'
'default'

Slots: children (trailing closure)

SEmptyTitle ​

text-lg font-medium tracking-tight.

PropTypeDefaultDescription
textResourceStr''

SEmptyDescription ​

text-muted-foreground text-sm/relaxed.

PropTypeDefaultDescription
textResourceStr''

SEmptyContent ​

flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm.

Slots: children (trailing closure)

MIT Licensed