Skip to content

Select

Custom role="combobox" select, styleable unlike a native <select>. Implements the ARIA combobox pattern: aria-expanded, aria-controls, aria-activedescendant tracks the highlighted option while focus stays on the trigger, and the listbox options get aria-selected. A hidden native <input> mirrors value when name is set.

Renders in light DOM (scoped styles, not Shadow DOM) on purpose: that hidden input is a real descendant of whatever <form> wraps this component, so it actually shows up in FormData on submit — inside a Shadow DOM it would be invisible to the enclosing form.

options accepts either a real array or a JSON string — each option is { value: string; text: string; disabled?: boolean } — so it works directly as a plain HTML attribute.

<and-select
label="Framework"
name="framework"
placeholder="Choose a framework"
options='[{"value":"angular","text":"Angular"},{"value":"react","text":"React"},{"value":"vue","text":"Vue"}]'
></and-select>
PropertyAttributeDescriptionTypeDefault
customClassclassAdditional CSS classes from the consumer.string''
describedBydescribed-byID of element describing this field.string''
disableddisabledDisables interaction when true.booleanfalse
hasErrorhas-errorWhether the select is in an error state.booleanfalse
labellabelAccessible label for the select.string''
menuPlacementmenu-placementMenu placement strategy."auto" | "bottom" | "top"'auto'
namenameName attribute forwarded to native select.string''
optionsoptionsOptions rendered in the select menu. Can be an array or a JSON string.SelectOption[] | string[]
placeholderplaceholderPlaceholder shown when no value is selected.string'Select an option'
requiredrequiredMarks the field as required.booleanfalse
valuevalueCurrent selected value.string''
EventDescriptionType
andSelectBlurEmitted when select loses focus / closes.CustomEvent<void>
andSelectChangeEmitted when selected value changes.CustomEvent<string>