Select

Displays an animated list of options for the user to choose from —smoothly triggered by a button.

Loading...

Installation

npx shadcn@latest add @scrollxui/select 

Usage

import {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"
<Select>
  <SelectTrigger className="w-[180px]">
    <SelectValue placeholder="Theme" />
  </SelectTrigger>
  <SelectContent>
    <SelectGroup>
      <SelectItem value="light">Light</SelectItem>
      <SelectItem value="dark">Dark</SelectItem>
      <SelectItem value="system">System</SelectItem>
    </SelectGroup>
  </SelectContent>
</Select>

API Reference

Select

Displays an animated list of options for the user to choose from —smoothly triggered by a button.

Props

PropertyTypeDefaultDescription
animatebooleantrue
Enables motion animations for trigger, dropdown, items, and separator.
valuestring
Controlled selected value.
defaultValuestring
Initial selected value (uncontrolled mode).
onValueChange(value: string) => void
Callback triggered when selected value changes.
openboolean
Controls dropdown open state.
defaultOpenboolean
Initial open state (uncontrolled mode).
onOpenChange(open: boolean) => void
Callback triggered when open state changes.
disabledbooleanfalse
Disables the entire Select component.
size (SelectTrigger)"default" | "sm""default"
Controls trigger height and radius styling.
position (SelectContent)"item-aligned" | "popper""item-aligned"
Controls dropdown positioning strategy.
align (SelectContent)"start" | "center" | "end""center"
Aligns dropdown relative to trigger.
value (SelectItem)stringrequired
Unique value for each Select item.
disabled (SelectItem)booleanfalse
Disables a specific Select item.
classNamestring
Custom Tailwind classes for styling any subcomponent.
childrenReactNoderequired
Used in: Select, Trigger, Content, Item, Group, Label — nested elements.
...propsRadix Select props
Supports all native Radix Select props and accessibility attributes.

Built withby Ahdeetai.