Reflex Logo
Docs Logo
Library

/

Forms

/

Select

High Level

Low Level

Displays a list of options for the user to pick from—triggered by a button.

apple

The on_open_change event handler acts in a similar way to the on_change and is called when the open state of the select changes.

The name prop is needed to submit with its owning form as part of a name/value pair.

When the required prop is True, it indicates that the user must select a value before the owning form can be submitted.

Example Form

Results:

{}

If using within a Drawer component, set the position prop to "popper" to ensure the select menu is displayed correctly.

API Reference

rx.select

High level wrapper for the Select component.

PropType | ValuesDefaultInteractive
size
"1" | "2" | ...
-
default_value
str
-
value
str
-
default_open
bool
-
open
bool
-
name
str
-
disabled
bool
-
required
bool
-
items
Sequence
-
placeholder
str
-
label
str
-
color_scheme
"tomato" | "red" | ...
-
high_contrast
bool
-
variant
"classic" | "surface" | ...
-
radius
"none" | "small" | ...
-
width
str
-
position
"item-aligned" | "popper"
-

Event Triggers

See the full list of default event triggers
TriggerDescription
on_changeFired when the value of the select changes.
on_open_changeFired when the select is opened or closed.

rx.select.root

Displays a list of options for the user to pick from, triggered by a button.

PropType | ValuesDefaultInteractive
size
"1" | "2" | ...
-
default_value
str
-
value
str
-
default_open
bool
-
open
bool
-
name
str
-
disabled
bool
-
required
bool
-

Event Triggers

See the full list of default event triggers
TriggerDescription
on_changeFired when the value of the select changes.
on_open_changeFired when the select is opened or closed.

rx.select.trigger

The button that toggles the select.

PropType | ValuesDefaultInteractive
variant
"classic" | "surface" | ...
-
color_scheme
"tomato" | "red" | ...
-
radius
"none" | "small" | ...
-
placeholder
str
-

rx.select.content

The component that pops out when the select is open.

PropType | ValuesDefaultInteractive
variant
"solid" | "soft"
-
color_scheme
"tomato" | "red" | ...
-
high_contrast
bool
-
position
"item-aligned" | "popper"
-
side
"top" | "right" | ...
-
side_offset
int
-
align
"start" | "center" | ...
-
align_offset
int
-

Event Triggers

See the full list of default event triggers
TriggerDescription
on_close_auto_focusFired when the select content is closed.
on_escape_key_downFired when the escape key is pressed.
on_pointer_down_outsideFired when a pointer down event happens outside the select content.

rx.select.group

Used to group multiple items.

Props

No component specific props

rx.select.item

The component that contains the select items.

PropType | ValuesDefaultInteractive
value
str
-
disabled
bool
-

rx.select.label

Used to render the label of a group, it isn't focusable using arrow keys.

Props

No component specific props

rx.select.separator

Used to visually separate items in the Select.

Props

No component specific props

Built with Reflex