选择器
用途
Add your select HTML
HTML 结构
<div class="select">Select root. Add
data-placeholderto show placeholder text when no value is selected. Supportsdata-close-on-select="true"for multiple select anddata-format="object"for serialized object values.<button type="button">- Trigger button. Use
aria-haspopup="listbox",aria-expanded, andaria-controls. <div data-popover aria-hidden="true">Popover content. Supports
data-sideanddata-alignthrough the shared Popover rules; the runtime flips and clamps the list to the visual viewport.<div role="listbox">Options container. Add
aria-multiselectable="true"for multiple selection.<div role="option" data-value="..." data-label="...">- Selectable option.
data-valueis submitted.data-labelis optional and controls the selected display label anddata-format="object"label; when omitted, A3S UI uses trimmed text content. <hr role="separator">Optional- Separator between groups or options.
<div role="group">Optional- Option group. Use
aria-labelledbyto connect it to its heading. <span role="heading">Optional- Group heading.
<input type="hidden">- Submitted value. Empty value means no selection when the root has
data-placeholder. Single select stores a string; multiple select stores a JSON array. Withdata-format="object", values are serialized as{ value, label }objects.
JavaScript API
示例
组
可滚动
包含许多滚动项目的选择。
已禁用
无效
Please select a valid fruit.