Docs
Select
Select
Displays a list of options for the user to pick from—triggered by a button.
Installation
pnpm dlx shadcn-solid@latest add select
Usage
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
<Select
options={["Apple", "Banana", "Blueberry", "Grapes", "Pineapple"]}
itemComponent={(props) => (
<SelectItem item={props.item}>{props.item.rawValue}</SelectItem>
)}
>
<SelectTrigger>
<SelectValue<string>>{(state) => state.selectedOption()}</SelectValue>
</SelectTrigger>
<SelectContent />
</Select>