Select
Displays a list of options for the user to pick from, triggered by a button.
Basic Example
Usage
Disabling
It is possible to disable individual items in a select using the disabled prop associated with the rx.select.item.
To prevent the user from interacting with select entirely, set the disabled prop to True on the rx.select.root component.
Setting Defaults
It is possible to set several default values when constructing a select.
The placeholder prop in the rx.select.trigger specifies the content that will be rendered when value or default_value is empty or not set.
The default_value in the rx.select.root specifies the value of the select when initially rendered.
The default_value should correspond to the value of a child rx.select.item.
Fully controlled
The on_change event trigger is fired when the value of the select changes.
In this example the rx.select_root value prop specifies which item is selected, and this
can also be controlled using state and a button without direct interaction with the select component.
ExpandCollapse
The open prop and on_open_change event trigger work similarly to value and on_change to control the open state of the select.
If on_open_change handler does not alter the open prop, the select will not be able to be opened or closed by clicking on the
select_trigger.
ExpandCollapse
Submitting a Form with Select
When a select is part of a form, the name prop of the rx.select.root sets the key that will be submitted with the form data.
The value prop of rx.select.item provides the value to be associated with the name key when the form is submitted with that item selected.
When the required prop of the rx.select.root is True, it indicates that the user must select a value before the form may be submitted.
Results
{}
ExpandCollapse
Real World Example

Reflex Swag
$99
Reflex swag with a sense of nostalgia, as if they carry whispered tales of past adventures
Color
Size
ExpandCollapse
API Reference
rx.select.root
Displays a list of options for the user to pick from, triggered by a button.
sizedisabledProps
| Prop | Type | Description |
|---|---|---|
size | "1""2""3" | The size of the select trigger. |
default_value | str | The value that's selected when the dropdown first renders. Use this when you want the select to start with a specific option but don't need to track the user's choice in app state. The value must match one of the options in the list. If both |
value | str | The currently selected value of the dropdown. When set, the component reflects this value and you must update it via an |
default_open | bool | Whether the dropdown menu is open when the component first renders. |
open | bool | Controls whether the dropdown menu is currently open. When set, you must update this prop via an |
name | str | The name attribute used when the select is submitted as part of an HTML form. This becomes the key in the submitted form data. If omitted, the select's value won't be included in form submissions. See Forms for more on integrating selects with form validation and submission. |
disabled | bool | When |
required | bool | When |
rx.select.trigger
The button that toggles the select.
variantcolor_schemeradiusProps
| Prop | Type | Description |
|---|---|---|
variant | "classic""surface""soft""ghost" | The visual style of the trigger. Same options and behavior as the |
color_scheme | "tomato""red""ruby""crimson""pink""plum""purple""violet""iris""indigo""blue""cyan""teal""jade""green""grass""brown""orange""sky""mint""lime""yellow""amber""gold""bronze""gray" | The text color of the trigger label. Accepts any Reflex color token. Use to make the trigger text stand out. For example, a red trigger color for an error state, or muted gray for a placeholder-like appearance. |
radius | "none""small""medium""large""full" | The border radius of the trigger. Same behavior as the |
placeholder | str | The text displayed in the trigger button when no option is selected. Same behavior as the |
Event Triggers
See the full list of default event triggersrx.select.content
The component that pops out when the select is open.
variantcolor_schemehigh_contrastalignProps
| Prop | Type | Description |
|---|---|---|
variant | "solid""soft" | The visual style of the dropdown menu surface. |
color_scheme | "tomato""red""ruby""crimson""pink""plum""purple""violet""iris""indigo""blue""cyan""teal""jade""green""grass""brown""orange""sky""mint""lime""yellow""amber""gold""bronze""gray" | Overrides the theme's accent color for the dropdown menu specifically. Affects the highlight color when hovering or arrow-key-navigating through items. Can differ from the trigger's |
high_contrast | bool | When |
position | "item-aligned""popper" | Controls how the dropdown menu positions itself relative to the trigger. Same behavior as |
side | "top""right""bottom""left" | Which side of the trigger the dropdown should appear on when using |
side_offset | int | The distance in pixels between the trigger and the dropdown menu when |
align | "start""center""end" | Horizontal alignment of the dropdown menu relative to the trigger when |
align_offset | int | Pixel offset for the alignment when |
rx.select.group
Used to group multiple items.
Props
No component specific props
Event Triggers
See the full list of default event triggersrx.select.item
The component that contains the select items.
disabledProps
| Prop | Type | Description |
|---|---|---|
value | str | The value associated with this option. Required. When this item is selected, the select's |
disabled | bool | When |
Event Triggers
See the full list of default event triggersrx.select.label
Used to render the label of a group, it isn't focusable using arrow keys.
Props
No component specific props
Event Triggers
See the full list of default event triggersrx.select.separator
Used to visually separate items in the Select.
Props
No component specific props