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

查看生态总览
Skip to content

PageHeader ​

Navigation 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="page-header": root · breadcrumb · back-trigger · media · title · description · extra · footer

API reference ​

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

Artifacts ​

LayerValue
Custom element<xh-page-header>
Vue componentsXhPageHeaderBackTrigger XhPageHeaderBreadcrumb XhPageHeaderDescription XhPageHeaderExtra XhPageHeaderFooter XhPageHeaderMedia XhPageHeaderRoot XhPageHeaderTitle
State machineNone: connect computes attributes from props directly
Skin@xihan-ui/styles/page-header.css

Props ​

PropTypeRequired
sizeSize
splitboolean
variantControlVariant

React adapter props ​

Only the props each component declares itself: DOM attributes inherited from ComponentPropsWithRef are left out, and root props already listed in the Props table are not repeated. The Vue counterpart is the slot table above.

React componentPropTypeRequired
XhPageHeaderBackTriggerasElementType
XhPageHeaderTitleasElementType

connect API ​

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

MemberType
getRootProps() => T['element']
getBreadcrumbProps() => T['element']
getBackTriggerProps() => T['element']
getMediaProps() => T['element']
getTitleProps() => T['element']
getDescriptionProps() => T['element']
getExtraProps() => T['element']
getFooterProps() => 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.

Style reference ​

Skin ​

@xihan-ui/styles/page-header.css is written against [data-scope="page-header"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-page-header 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-split'' (present only while the condition holds)
rootdata-variantprops.variant
back-triggerdata-xh-action-control''
back-triggerdata-xh-action-display'always'
back-triggerdata-xh-action-profile'icon'
back-triggerdata-xh-action-size'md' | 'sm'
back-triggerdata-xh-action-variant'ghost'

CSS variables ​

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

VariablePartCSS propertyStateDefault from
--xh-page-header-back-fgback-triggercolordefault--xh-fg-muted
--xh-page-header-back-fg-hoverback-triggercolordisabled
hover
is(:active, [data-pressed])
loading
not([data-disabled])
not([data-loading])
pressed
--xh-fg-default
--xh-page-header-bgrootbackgroundvariant=outline
variant=subtle
--xh-bg-subtle
--xh-bg-surface
--xh-page-header-borderrootborder
border-block-end
split
variant=ghost
variant=outline
--xh-border-default
--xh-page-header-breadcrumb-fgbreadcrumbcolordefault--xh-fg-muted
--xh-page-header-breadcrumb-font-sizebreadcrumbfont-sizedefault--xh-text-secondary-size
--xh-page-header-column-gapback-trigger
extra
media
margin-inline-end
margin-inline-start
default--xh-space-3
--xh-page-header-description-fgdescriptioncolordefault--xh-fg-subtle
--xh-page-header-description-font-sizedescriptionfont-sizedefault--xh-text-body-size
--xh-page-header-dividerdescription
title
backgrounddefault--xh-border-default
--xh-page-header-extra-gapextragapdefault--xh-space-2
--xh-page-header-fgrootcolordefault--xh-fg-default
--xh-page-header-footer-fgfootercolordefault--xh-fg-muted
--xh-page-header-footer-font-sizefooterfont-sizedefault--xh-text-secondary-size
--xh-page-header-pxrootpadding-inlinedefault--xh-_page-header-px
--xh-page-header-pyrootpadding-blockdefault--xh-_page-header-py
--xh-page-header-radiusrootborder-radiusdefault--xh-_page-header-radius
--xh-page-header-row-gaprootrow-gapdefault--xh-_page-header-row-gap
--xh-page-header-title-fgtitlecolordefault--xh-fg-default
--xh-page-header-title-font-sizetitlefont-sizedefault--xh-_page-header-title-size
--xh-page-header-title-font-weighttitlefont-weightdefault--xh-text-heading-2-weight

Released under The MIT License