Primitive

Select

Displays a list of options for the user to pick from, triggered by a button.

Installation

npx benflux-ui add select

Usage

import {
  Select, SelectContent, SelectItem,
  SelectTrigger, SelectValue,
} from "@benflux-ui/react"

<Select onValueChange={(value) => console.log(value)}>
  <SelectTrigger>
    <SelectValue placeholder="Pick an option" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="option1">Option 1</SelectItem>
    <SelectItem value="option2">Option 2</SelectItem>
  </SelectContent>
</Select>

Props — Select

PropTypeDefaultDescription
valuestringControlled value of the select
defaultValuestringDefault value (uncontrolled)
onValueChange(value: string) => voidCalled when the selected value changes
disabledbooleanfalseDisables the select