Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Select

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

Installation

npx logic2b@latest add select

Usage

import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"

<Select>
  <SelectTrigger className="w-[180px]">
    <SelectValue placeholder="Select a fruit" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="apple">Apple</SelectItem>
  </SelectContent>
</Select>

API

Prop Type Default
value / defaultValue (Select) string
onValueChange (Select) (value: string) => void
disabled (Select) boolean false
size (SelectTrigger) sm | default default
position (SelectContent) popper | item-aligned popper
disabled (SelectItem) boolean false

Examples

Grouped options

With a disabled option

Accessibility

Built on Radix Select, following the WAI-ARIA listbox pattern.

  • Fully keyboard operable: open with Enter/Space/arrow keys, move with arrows, and type-ahead to jump to an option.
  • Esc closes the list and focus returns to the trigger.
  • The trigger exposes the selected value to assistive technology; use SelectValue’s placeholder for the empty state.
  • Group related options with SelectGroup + SelectLabel for clearer announcements.