Select
The menu opens with focus on the selected option, and arrow keys, Home, and End move between options. Use a Combobox when people need to search the list.
Installation
Copy the command below and run it in your terminal.
Usage
Bind value on Select.Root; it is an empty string until
an option is picked. An empty trigger shows the selected option's text. Add Select.Value inside it to set the placeholder.
Examples
Basic
Scrollable
Add a max-h-* class to Select.Content to cap the menu height. Longer lists scroll inside it.
Dynamic width
Set dynamic on Select.Content to size the menu to its longest option, even when the trigger is narrower.
Anatomy
Select.Root - Provides select state.
Select.Trigger - Opens the select menu.
Select.Value - Displays the selected value.
Select.Label - Labels a select section.
Select.Item - Defines a selectable option.
Select.Content - Renders select options.
bunx @sivir-ui/svelte add select