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

查看生态总览
Skip to content

InputGroup ​

Data entry 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="input-group": root · item

API reference ​

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

Artifacts ​

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

Props ​

PropTypeRequired
sizeSize
variantControlVariant

connect API ​

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

MemberType
getRootProps() => T['element']
getItemProps() => 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/input-group.css is written against [data-scope="input-group"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-input-group 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-variantprops.variant

CSS variables ​

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

VariablePartCSS propertyStateDefault from
--xh-input-group-bgrootbackgrounddefault--xh-_input-group-bg
--xh-input-group-bg-disabledrootbackgrounddisabled
has([data-xh-field-chrome][data-disabled])
xh-field-chrome
--xh-bg-subtle
--xh-input-group-bg-focusrootbackgroundfocus-within--xh-_input-group-bg-focus
--xh-input-group-bg-hoverrootbackgrounddisabled
hover
invalid
not(:focus-within)
not(:has([data-xh-field-chrome]:is([data-disabled], [data-readonly])
readonly
xh-field-chrome
--xh-_input-group-bg-hover
--xh-input-group-bg-invalidrootbackgroundhas([data-invalid], [aria-invalid='true'])
invalid
--xh-bg-field-invalid
--xh-input-group-bg-read-onlyrootbackgroundhas(:where([data-xh-field-chrome][data-readonly])
readonly
xh-field-chrome
--xh-bg-subtle
--xh-input-group-borderrootborderdefault--xh-_input-group-border
--xh-input-group-border-disabledrootborder-colordisabled
has([data-xh-field-chrome][data-disabled])
xh-field-chrome
--xh-border-default
--xh-input-group-border-focusrootborder-color
box-shadow
focus-within--xh-_input-group-border-focus
--xh-input-group-border-hoverrootborder-colordisabled
hover
invalid
not(:focus-within)
not(:has([data-xh-field-chrome]:is([data-disabled], [data-readonly])
readonly
xh-field-chrome
--xh-_input-group-border-hover
--xh-input-group-border-invalidrootborder-colorhas([data-invalid], [aria-invalid='true'])
invalid
--xh-border-invalid
--xh-input-group-item-bgitembackground-colordefault--xh-bg-subtle
--xh-input-group-item-divideritem
root
border-inline-end
border-inline-start
not(:first-child)
not(:has(+ [data-scope='input-group'][data-part='item'])
not(:last-child)
--xh-border-default
--xh-input-group-item-fgitemcolordefault--xh-fg-default
--xh-input-group-item-font-sizeitemfont-sizedefault--xh-_input-group-font-size
--xh-input-group-item-hitemblock-sizedefault--xh-_input-group-h
--xh-input-group-item-pxitempadding-inlinedefault--xh-_input-group-px
--xh-input-group-radiuscontrol
root
border-end-end-radius
border-end-start-radius
border-radius
border-start-end-radius
border-start-start-radius
default
first-child
is(*, [data-part='control'], [data-part='root'])
is([data-part='control'], [data-part='root'])
last-child
--xh-shape-control
--xh-input-group-shadowrootbox-shadowdefault--xh-_input-group-shadow
--xh-input-group-wrootinline-sizedefault--xh-control-w

Released under The MIT License