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

查看生态总览
Skip to content

Marquee ​

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="marquee": root · content · autoplay-trigger

API reference ​

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

Artifacts ​

LayerValue
Custom element<xh-marquee>
Vue componentsXhMarqueeAutoplayTrigger XhMarqueeContent XhMarqueeRoot
State machinemarqueeMachine
Skin@xihan-ui/styles/marquee.css

Props ​

PropTypeRequired
directionMarqueeDirection
speednumber
pauseOnHoverboolean
pausedboolean
defaultPausedboolean
autoFillboolean
fadeboolean
translationsPartial<MarqueeTranslations>
onPausedChange(details: MarqueePausedChangeDetails) => void

Events ​

Custom elements put the payload in detail; Vue emits an event of the same name.

EventPayload
paused-changeMarqueePausedChangeDetails

Slots ​

Only slots with a payload are listed.

Vue componentSlotPayload
XhMarqueeRootdefault—

State ​

Public state is written to data-state.

PartValues
autoplay-trigger'paused' | 'running'

The following names are internal to the state machine.

States: idle

Events: PAUSED.SET · PAUSED.TOGGLE · PRESS.START · PRESS.END · SPAN.MEASURE

connect API ​

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

MemberType
copiesnumber
pausedboolean
setPaused(paused: boolean) => void
getRootProps() => T['element']
getContentProps() => T['element']
getAutoplayTriggerProps() => T['button']

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.

KeysBehavior
Enter / Spacemarquee.kbd.activate
Enter / Spacemarquee.kbd.press

ARIA ​

These attributes are produced by connect.

PartAttributeValue
autoplay-triggeraria-controlsscope.partId('marquee', 'content')
autoplay-triggeraria-labellabel.autoplayTriggerPlay | label.autoplayTriggerPause

Style reference ​

Skin ​

@xihan-ui/styles/marquee.css is written against [data-scope="marquee"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-marquee 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
autoplay-triggerdata-pressed'' (present only while the condition holds)
autoplay-triggerdata-state'paused' | 'running'
autoplay-triggerdata-xh-action-control''
autoplay-triggerdata-xh-action-display'always'
autoplay-triggerdata-xh-action-profile'icon'
autoplay-triggerdata-xh-action-size'md'
autoplay-triggerdata-xh-action-variant'outline'

CSS variables ​

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

VariablePartCSS propertyStateDefault from
--xh-marquee-block-sizerootblock-sizeorientation=vertical10rem
--xh-marquee-fade-sizeroot-webkit-mask-image
mask-image
fade--xh-space-6
--xh-marquee-gapcontent
root
padding-block-end
padding-inline-end
orientation=vertical
xh-copy
--xh-space-6
--xh-marquee-icon-sizeautoplay-trigger--xh-icon-sizedefault--xh-_action-profile-glyph-size
--xh-marquee-spancontent
root
animation-durationauto-fill
default
--xh-_marquee-measured-span
--xh-marquee-speedcontent
root
animation-durationauto-fill
default
60
--xh-marquee-trigger-bgautoplay-trigger--xh-ink-surface
background-color
default
focus-visible
xh-ink-surface
--xh-bg-surface
--xh-marquee-trigger-bg-activeautoplay-triggerbackground-colordisabled
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-bg-subtle-hover-opaque
--xh-marquee-trigger-bg-hoverautoplay-triggerbackground-colordisabled
hover
loading
not([data-disabled])
not([data-loading])
--xh-bg-subtle-opaque
--xh-marquee-trigger-insetautoplay-trigger
root
-webkit-mask-image
-webkit-mask-size
inset-block-end
inset-inline-end
mask-image
mask-size
default
fade
has(> [data-scope='marquee'][data-part='autoplay-trigger']:not([hidden])
orientation=vertical
--xh-space-1

Released under The MIT License