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

查看生态总览
Skip to content

Separator ​

Layout 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="separator": root · line · content

API reference ​

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

Artifacts ​

LayerValue
Custom element<xh-separator>
Vue componentsXhSeparator XhSeparatorContent XhSeparatorLine XhSeparatorRoot
State machineNone: connect computes attributes from props directly
Skin@xihan-ui/styles/separator.css

Props ​

PropTypeRequired
alignSeparatorAlign
dashedboolean
decorativeboolean
orientation'horizontal' | 'vertical'
variantSeparatorVariant

connect API ​

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

MemberType
getRootProps() => T['element']
getLineProps() => T['element']
getContentProps() => 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-hidden'true' | undefined
rootaria-orientation'vertical' | undefined
rootrole'none' | 'separator'
linerole'none'

Style reference ​

Skin ​

@xihan-ui/styles/separator.css is written against [data-scope="separator"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-separator 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-alignprops.align
rootdata-dashed'' (present only while the condition holds)
rootdata-orientationprops.orientation
rootdata-variantprops.variant
linedata-orientationprops.orientation

CSS variables ​

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

VariablePartCSS propertyStateDefault from
--xh-separator-align-lengthline
root
flexalign=end
align=start
first-child
last-child
--xh-space-6
--xh-separator-colorline
root
backgrounddashed
default
orientation=horizontal
orientation=vertical
variant=strong
variant=subtle
--xh-border-default
--xh-border-strong
--xh-material-soft-separator
--xh-separator-content-fgcontentcolordefault--xh-fg-default
--xh-separator-content-font-sizecontentfont-sizedefault--xh-text-body-size
--xh-separator-content-font-weightcontentfont-weightdefault--xh-font-weight-medium
--xh-separator-dash-gapline
root
backgrounddashed
orientation=horizontal
orientation=vertical
--xh-space-1_5
--xh-separator-dash-lengthline
root
backgrounddashed
orientation=horizontal
orientation=vertical
--xh-space-1_5
--xh-separator-gaprootgaphas([data-part='content'])--xh-space-4
--xh-separator-mxrootmargin-inlineorientation=vertical--xh-space-3
--xh-separator-myrootmargin-blockhas([data-part='content'])
orientation=horizontal
--xh-space-2_5
--xh-space-5
--xh-separator-radiusline
root
border-radiusdefault--xh-shape-pill
--xh-separator-thicknessline
root
block-size
inline-size
orientation=horizontal
orientation=vertical
--xh-stroke-thin

Released under The MIT License