Select
Pick one option from a list. The trigger has the same size and border as the Input, and every option is a 44px row.
Installation
npx shadcn@latest add @sevenone/selectUsage
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"Examples
Default
<Label htmlFor="country">Country</Label>
<Select>
<SelectTrigger id="country">
<SelectValue placeholder="Select a country" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>South America</SelectLabel>
<SelectItem value="br">Brazil</SelectItem>
<SelectItem value="ar">Argentina</SelectItem>
<SelectItem value="cl">Chile</SelectItem>
</SelectGroup>
</SelectContent>
</Select>Accessibility
- Full keyboard support: arrows, Home/End, type-ahead, Enter and Esc.
- Give the trigger an id and connect it to a Label.
- Options are 44px tall.