# Select Select provides an expandable list of options for choosing one value from multiple candidates. ## Use cases - **Suitable**: Choosing one value from multiple options - **Suitable**: Forms with many options where page space should be preserved - **Suitable**: Options that can be grouped by category - **Not suitable**: Choosing multiple values at once (use `checkbox`) ## Usage ```tsx import { Select, SelectTrigger, SelectValue, SelectContent, SelectGroup, SelectLabel, SelectItem } from "@lcui/react" ``` ```tsx ``` ## Composition Use the following composition to build a `Select`: ``` Select ├── SelectTrigger │ └── SelectValue └── SelectContent ├── SelectGroup │ ├── SelectLabel │ ├── SelectItem │ └── SelectItem ├── SelectSeparator └── SelectGroup ├── SelectLabel ├── SelectItem └── SelectItem ``` ## Groups Wrap a set of related options in `SelectGroup` and use `SelectLabel` as the group heading; when the panel holds several groups, use `SelectSeparator` to draw a divider between them. ## Align Item With Trigger By default, opening a `Select` makes the popup **overlap the trigger** so the **selected item** sits at the same height as it; when nothing is selected the first item is aligned instead. If the trigger is near the bottom of the window and there is not enough room to align, the popup flips above the trigger and shows a scrollbar. Set `align-item-with-trigger` to `false` to disable aligning and expand the popup against the trigger edge. ## Scrollable When the options exceed the available height the popup is capped to that height and shows a scrollbar; when the trigger is near the bottom of the window the popup flips above it and uses the space available on that side. ## Disabled Setting `disabled` on `Select` lowers the opacity of the trigger and stops the content panel from opening; you can also disable an individual `SelectItem`, which then cannot be selected. ## API Reference ### Select The Select state container that manages the current value, placeholder, and content panel. ### SelectTrigger The trigger that opens or closes the content panel. ### SelectContent The option panel mounted at the root level through Portal. ### SelectGroup A container that groups related options, optionally headed by a `SelectLabel`. ### SelectLabel The small heading text for an option group. ### SelectSeparator A thin divider between option groups. ### SelectItem An option representing one selectable value.