Basic Usage
Sizes
Select supports 5 different sizes:The size of the select component
Controlled Value
Event Handlers
Props Reference
List of items to display in the dropdown
Text shown when no item is selected
Currently selected value (controlled)
Initial selected value (uncontrolled)
Event fired when selection changes
Event fired when dropdown opens or closes
Disables the select component
Form field name for submission
Makes selection required for form submission
Prevents changing the selection
Allows selecting multiple items
Positioning
Which side of the trigger to position the dropdown
How to align the dropdown relative to the trigger
Distance between trigger and dropdown in pixels
Modal Behavior
When True, locks page scroll and disables outside interactions
Advanced Composition
For complex use cases, use the compositional API:Real Example
From demo atdemo/demo.py:47:
Select Components
select.root- Container for all select partsselect.trigger- Button that opens the dropdownselect.value- Displays the selected valueselect.icon- Icon indicating dropdown stateselect.portal- Portals dropdown to bodyselect.positioner- Positions the dropdownselect.popup- Container for itemsselect.item- Individual selectable itemselect.item_text- Text content of an itemselect.item_indicator- Shows which item is selectedselect.group- Groups related itemsselect.group_label- Label for a groupselect.separator- Visual separator between items
Implementation Details
From source code atreflex_ui/components/base/select.py:466:
- Built on Base UI Select primitives
- High-level wrapper auto-generates items with foreach
- Items rendered as buttons with indicator icons
- Supports both static and reactive item lists
- Keyboard navigable with arrow keys