English
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
| Layer | Value |
|---|---|
| Custom element | <xh-separator> |
| Vue components | XhSeparator XhSeparatorContent XhSeparatorLine XhSeparatorRoot |
| State machine | None: connect computes attributes from props directly |
| Skin | @xihan-ui/styles/separator.css |
Props
| Prop | Type | Required |
|---|---|---|
align | SeparatorAlign | |
dashed | boolean | |
decorative | boolean | |
orientation | 'horizontal' | 'vertical' | |
variant | SeparatorVariant |
connect API
getXxxProps() returns the host attributes of the matching part.
| Member | Type |
|---|---|
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.
| Part | Attribute | Value |
|---|---|---|
root | aria-hidden | 'true' | undefined |
root | aria-orientation | 'vertical' | undefined |
root | role | 'none' | 'separator' |
line | role | '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.
| Part | Attribute | Value |
|---|---|---|
root | data-align | props.align |
root | data-dashed | '' (present only while the condition holds) |
root | data-orientation | props.orientation |
root | data-variant | props.variant |
line | data-orientation | props.orientation |
CSS variables
The public override slots, generated from what the standalone skin actually consumes.
| Variable | Part | CSS property | State | Default from |
|---|---|---|---|---|
--xh-separator-align-length | lineroot | flex | align=endalign=startfirst-childlast-child | --xh-space-6 |
--xh-separator-color | lineroot | background | dasheddefaultorientation=horizontalorientation=verticalvariant=strongvariant=subtle | --xh-border-default--xh-border-strong--xh-material-soft-separator |
--xh-separator-content-fg | content | color | default | --xh-fg-default |
--xh-separator-content-font-size | content | font-size | default | --xh-text-body-size |
--xh-separator-content-font-weight | content | font-weight | default | --xh-font-weight-medium |
--xh-separator-dash-gap | lineroot | background | dashedorientation=horizontalorientation=vertical | --xh-space-1_5 |
--xh-separator-dash-length | lineroot | background | dashedorientation=horizontalorientation=vertical | --xh-space-1_5 |
--xh-separator-gap | root | gap | has([data-part='content']) | --xh-space-4 |
--xh-separator-mx | root | margin-inline | orientation=vertical | --xh-space-3 |
--xh-separator-my | root | margin-block | has([data-part='content'])orientation=horizontal | --xh-space-2_5--xh-space-5 |
--xh-separator-radius | lineroot | border-radius | default | --xh-shape-pill |
--xh-separator-thickness | lineroot | block-sizeinline-size | orientation=horizontalorientation=vertical | --xh-stroke-thin |
