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

查看生态总览
Skip to content

Progress ​

Feedback 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="progress": root · canvas · track · range · buffer · label · threshold · target · scale · scale-tick · scale-label · needle

API reference ​

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

Artifacts ​

LayerValue
Custom element<xh-progress>
Vue componentsXhProgress
State machineNone: connect computes attributes from props directly
Skin@xihan-ui/styles/progress.css

Props ​

PropTypeRequired
buffernumber
gapDegreenumber
gapPositionProgressGapPosition
indeterminateboolean
indicatorProgressIndicator
localestring
maxnumber
scaleboolean | ProgressScaleOptions
semanticsProgressSemantics
sizeSize
stepsnumber
stripedboolean
strokeWidthnumber
targetnumber
thresholdsreadonly ProgressThreshold[]
toneTone
translationsPartial<ProgressTranslations>
valuenumber
valueTextstring
variantProgressVariant

ProgressThreshold ​

Elements of thresholds.

FieldTypeRequired
valuenumberYes
toneToneYes
labelstring

State ​

Public state is written to data-state.

PartValues
root'indeterminate' | 'complete' | 'loading'
label'complete' | 'loading'

connect API ​

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

MemberType
variantProgressVariant
semanticsProgressSemantics
rationumber
percentnumber
stepsnumber
buffernumber | null
getRootProps() => T['element']
getCanvasProps() => T['element']
getTrackProps() => T['element']
getRangeProps() => T['element']
getBufferProps() => T['element']
getLabelProps() => T['element']
bandsreadonly ProgressBand[]
ticksreadonly ProgressTick[]
targetnumber | null
indicatorProgressIndicator
getThresholdProps(band: ProgressBand) => T['element']
getTargetProps() => T['element']
getScaleProps() => T['element']
getScaleTickProps(tick: ProgressTick) => T['element']
getScaleLabelProps(tick: ProgressTick) => T['element']
getNeedleProps() => 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
rootaria-valuemaxString(max)
rootaria-valuemin'0'
rootaria-valuenowundefined | String(value)
rootaria-valuetextprops.valueText
rootrole'meter' | 'progressbar'
canvasaria-hidden'true'
scalearia-hidden'true'

Style reference ​

Skin ​

@xihan-ui/styles/progress.css is written against [data-scope="progress"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-progress in place of data-scope (same specificity) and sits in the xihan.components and xihan.motion layers. 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-banded'' (present only while the condition holds)
rootdata-indicator'needle' | undefined
rootdata-sizeprops.size
rootdata-state'indeterminate' | 'complete' | 'loading'
rootdata-toneprops.tone
rootdata-variantprops.variant
canvasdata-variantprops.variant
trackdata-stepped'' (present only while the condition holds)
rangedata-empty'' (present only while the condition holds)
rangedata-indicator'needle' | undefined
rangedata-striped'' (present only while the condition holds)
rangedata-toneactive?.tone
bufferdata-toneprops.tone
bufferdata-variantprops.variant
labeldata-indicator'needle' | undefined
labeldata-state'complete' | 'loading'
labeldata-variantprops.variant
thresholddata-toneband.tone
thresholddata-variantprops.variant
targetdata-variantprops.variant
scaledata-variantprops.variant
scale-tickdata-variantprops.variant
scale-labeldata-variantprops.variant

CSS variables ​

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

VariablePartCSS propertyStateDefault from
--xh-progress-bufferbufferbackgrounddefault--xh-_tone-subtle-active
--xh-progress-buffer-radiusbufferborder-radiusdefault--xh-progress-range-radius
--xh-progress-indeterminate-durationrangeanimationstate=indeterminate--xh-motion-loop-shimmer
--xh-progress-label-fglabelcolordefault--xh-fg-muted
--xh-progress-label-font-sizelabelfont-sizedefault--xh-text-caption-size
--xh-progress-linecaprangestroke-linecapvariant=circle
variant=dashboard
round
--xh-progress-needle-colorneedlefilldefault--xh-fg-default
--xh-progress-rangerangebackground
stroke
default
variant=circle
variant=dashboard
--xh-_tone
--xh-progress-range-radiusbuffer
range
border-radiusdefault--xh-shape-pill
--xh-progress-sizerootblock-size
inline-size
size=lg
size=sm
variant=circle
variant=dashboard
10rem
5rem
7.5rem
--xh-progress-step-gaptrack-webkit-mask-image
mask-image
stepped--xh-space-0_5
--xh-progress-stripe-colorrangebackground-imagestriped--xh-_tone-active
--xh-progress-stripe-durationrangeanimationstate=loading
striped
--xh-motion-loop-shimmer
--xh-progress-stripe-sizerangebackground-position
background-size
@keyframes xh-progress-stripes
striped
--xh-space-4
--xh-progress-target-colortargetbackground
stroke
variant=circle
variant=dashboard
variant=line
--xh-fg-default
--xh-progress-target-radiustargetborder-radiusvariant=line--xh-shape-pill
--xh-progress-thicknessroot
target
track
block-sizebanded
default
size=lg
size=sm
variant=line
--xh-track-band-thickness-lg
--xh-track-band-thickness-md
--xh-track-band-thickness-sm
--xh-track-thickness-lg
--xh-track-thickness-md
--xh-track-thickness-sm
--xh-progress-threshold-colorthresholdbackground
stroke
variant=circle
variant=dashboard
variant=line
--xh-_tone-subtle-active
--xh-progress-tracktrackbackground
stroke
default
variant=circle
variant=dashboard
--xh-bg-subtle-hover
--xh-progress-track-radiustrackborder-radiusdefault--xh-shape-pill

Released under The MIT License