Select
A select with its own dropdown (keyboard, typeahead, groups); options from child <option> elements or the data property. Form-associated.
Dependent selects
Groups, descriptions and errors
Variants, sizes and states
Sort by
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-select> · RaySelect
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | Selected value. | |
data | — | array | Options as strings or { value, label, disabled } (instead of child options). | |
placeholder | placeholder | string | Shown while nothing is selected (with required, blocks submit). | |
open | open reflects | boolean | The dropdown is shown. | |
native | native reflects | auto | always | never | auto | Which 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. |
name | name | string | Form field name. | |
label | label | string | Visible label. | |
description | description | string | Help text. | |
descriptionPosition | description-position reflects | above | below | above | The description before the control (help first) or after it, with the error (fields in a row stay aligned). |
error | error | string | Error text. | |
required | required | boolean | Required for form submission. | |
disabled | disabled | boolean | Not interactive nor submitted. | |
size | size reflects | xs | sm | md | lg | xl | sm | Height and font size. |
variant | variant reflects | default | filled | unstyled | default | Box style. |
| Event | Description |
|---|---|
input | When the selection changes. |
change | When the selection changes. |
ray-open | The dropdown opened. |
ray-close | The dropdown closed. |
| Slot | Description |
|---|---|
| (default) | <option> and <optgroup> elements. |
| Part | Description |
|---|---|
trigger | The combobox button showing the selected option. |
dropdown | The listbox panel (a popover in the top layer). |
option | Each option in the dropdown ([aria-selected], [data-active], [aria-disabled]). |
select | The hidden native <select> that holds the value (the model). |
wrapper | The box. |
Texts
What it writes itself, in English; setStrings() translates them (Getting started: Languages).
| Key | English |
|---|---|
select.empty | No options |