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

查看生态总览
Skip to content

Highlight ​

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="highlight": root · mark

API reference ​

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

Artifacts ​

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

Props ​

PropTypeRequired
caseSensitiveboolean
keywordstring | readonly string[]
textstring
toneTone

connect API ​

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

MemberType
textstring
segmentsreadonly HighlightSegment[]
getRootProps() => T['element']
getMarkProps() => 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/highlight.css is written against [data-scope="highlight"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-highlight 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-case-sensitive'' (present only while the condition holds)
rootdata-toneprops.tone

CSS variables ​

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

VariablePartCSS propertyStateDefault from
--xh-highlight-mark-bgmark
root
backgrounddefault
tone
--xh-_tone-subtle
--xh-bg-mark
--xh-highlight-mark-fgmark
root
colordefault
tone
--xh-_tone-fg
--xh-fg-default
--xh-highlight-mark-font-weightmarkfont-weightdefault--xh-font-weight-medium
--xh-highlight-mark-pxmarkpadding-inlinedefault--xh-space-0_5
--xh-highlight-mark-radiusmarkborder-radiusdefault--xh-shape-inset

Released under The MIT License