生态产品多个设计器现已发布候选版本

查看生态总览
Skip to content

EmptyState ​

Data display component. This page is the API reference, generated from the source code. Usage guidance and live examples are on the Chinese page.

Anatomy ​

Parts in bold are required.

data-scope="empty-state": root · media · indicator · title · description · action

API reference ​

Descriptions of individual props, events and slots are written in Chinese and appear on the Chinese page.

Artifacts ​

LayerValue
Custom element<xh-empty-state>
Vue componentsXhEmptyStateAction XhEmptyStateDescription XhEmptyStateIndicator XhEmptyStateMedia XhEmptyStateRoot XhEmptyStateTitle
State machineemptyStateMachine
Skin@xihan-ui/styles/empty-state.css

Props ​

PropTypeRequired
liveEmptyStateLive
sizeSize
statusEmptyStateStatus
toneTone

State ​

The following names are internal to the state machine.

States: idle

Events: APPEARANCE.RELEASE

connect API ​

getXxxProps() returns the host attributes of the matching part.

MemberType
liveEmptyStateLive
getRootProps() => T['element']
getMediaProps() => T['element']
getIndicatorProps() => T['element']
getTitleProps() => T['element']
getDescriptionProps() => T['element']
getActionProps() => T['element']

Accessibility ​

Keyboard ​

Specification: W3C APG. Each row is a stable behavior id that the conformance tests cover; the conditions and effects are described on the Chinese page.

No keyboard interaction: the component takes no focus, or focus behavior comes entirely from native elements.

ARIA ​

These attributes are produced by connect.

PartAttributeValue
rootroleundefined | 'status'
mediaaria-hidden'true'
indicatoraria-hidden'true'

Style reference ​

Skin ​

@xihan-ui/styles/empty-state.css is written against [data-scope="empty-state"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-empty-state in place of data-scope (same specificity) and sits in the xihan.components layer. Put overrides in xihan.overrides; the part selectors work as usual.

Data attributes ​

Produced by connect; valueless attributes are omitted while their condition does not hold.

PartAttributeValue
rootdata-sizeprops.size
rootdata-statusprops.status
rootdata-toneprops.tone
mediadata-instant'' (present only while the condition holds)
indicatordata-instant'' (present only while the condition holds)
titledata-instant'' (present only while the condition holds)
descriptiondata-instant'' (present only while the condition holds)
actiondata-instant'' (present only while the condition holds)

CSS variables ​

The public override slots, generated from what the standalone skin actually consumes.

VariablePartCSS propertyStateDefault from
--xh-empty-state-action-gapactiongapdefault--xh-space-2
--xh-empty-state-description-fgdescriptioncolordefault--xh-fg-muted
--xh-empty-state-description-font-sizedescriptionfont-sizedefault--xh-text-secondary-size
--xh-empty-state-description-leadingdescriptionline-heightdefault--xh-leading-normal
--xh-empty-state-description-max-wdescriptionmax-inline-sizedefault--xh-measure-prose
--xh-empty-state-fgrootcolordefault--xh-fg-default
--xh-empty-state-gapdescription
root
title
gap
margin-block-start
default--xh-_empty-state-gap
--xh-empty-state-icon-sizeindicator
root
--xh-icon-size
block-size
font-size
inline-size
default
tone
--xh-_empty-state-icon-size
--xh-glyph-size-md
--xh-empty-state-indicator-bgindicator
root
backgroundtone--xh-_tone-subtle
--xh-empty-state-indicator-boxindicator
root
block-size
inline-size
tone--xh-control-box-lg
--xh-empty-state-indicator-fgindicatorcolordefault--xh-_empty-state-accent
--xh-empty-state-indicator-font-sizeindicatorfont-sizedefault--xh-_empty-state-icon-size
--xh-empty-state-indicator-radiusindicator
root
border-radiustone--xh-shape-circle
--xh-empty-state-media-fgmediacolordefault--xh-_empty-state-accent
--xh-empty-state-media-sizemediablock-sizedefault--xh-_empty-state-icon-size
--xh-empty-state-pxrootpadding-inlinedefault--xh-space-6
--xh-empty-state-pyrootpadding-blockdefault--xh-_empty-state-py
--xh-empty-state-title-fgtitlecolordefault--xh-fg-default
--xh-empty-state-title-font-sizetitlefont-sizedefault--xh-_empty-state-title-size
--xh-empty-state-title-font-weighttitlefont-weightdefault--xh-font-weight-medium
--xh-empty-state-title-leadingtitleline-heightdefault--xh-leading-normal

Released under The MIT License