Select

A select with its own dropdown (keyboard, typeahead, groups); options from child <option> elements or the data property. Form-associated.

Source on GitHub

Dependent selects
Pick a country and a city to see the delivery estimate.
Groups, descriptions and errors
Variants, sizes and states
Sort by
Code

API

For AI agents: this API as Markdown, or every component in llms-full.txt.

<ray-select> · RaySelect

PropertyAttributeTypeDefaultDescription
valuevaluestringSelected value.
data—arrayOptions as strings or { value, label, disabled } (instead of child options).
placeholderplaceholderstringShown while nothing is selected (with required, blocks submit).
openopen reflectsbooleanThe dropdown is shown.
nativenative reflectsauto | always | neverautoWhich dropdown a tap opens: the system's picker (the native select's, the usual one on a phone) or the component's list. auto: the system's on a touch screen (pointer: coarse), else the list. The value, events and shown text follow either.
namenamestringForm field name.
labellabelstringVisible label.
descriptiondescriptionstringHelp text.
descriptionPositiondescription-position reflectsabove | belowaboveThe description before the control (help first) or after it, with the error (fields in a row stay aligned).
errorerrorstringError text.
requiredrequiredbooleanRequired for form submission.
disableddisabledbooleanNot interactive nor submitted.
sizesize reflectsxs | sm | md | lg | xlsmHeight and font size.
variantvariant reflectsdefault | filled | unstyleddefaultBox style.
EventDescription
inputWhen the selection changes.
changeWhen the selection changes.
ray-openThe dropdown opened.
ray-closeThe dropdown closed.
SlotDescription
(default)<option> and <optgroup> elements.
PartDescription
triggerThe combobox button showing the selected option.
dropdownThe listbox panel (a popover in the top layer).
optionEach option in the dropdown ([aria-selected], [data-active], [aria-disabled]).
selectThe hidden native <select> that holds the value (the model).
wrapperThe box.

Texts

What it writes itself, in English; setStrings() translates them (Getting started: Languages).

KeyEnglish
select.emptyNo options