Dinachi

Select

A form control for choosing one option from a list of predefined values.

View Source

#Installation

npx @dinachi/cli@latest add select

#Usage

tsx
import {
  Select,
  SelectGroup,
  SelectValue,
  SelectTrigger,
  SelectContent,
  SelectBackdrop,
  SelectFieldLabel,
  SelectLabel,
  SelectItem,
  SelectItemIndicator,
  SelectArrow,
  SelectScrollUpArrow,
  SelectScrollDownArrow,
  SelectSeparator,
} from "@/components/ui/select"

#Examples

#API Reference

PropTypeDefaultDescription
valuestringThe controlled selected value.
defaultValuestringThe initially selected value when uncontrolled.
onValueChange(value: string) => voidCallback fired when selection changes.
SelectContent.portalbooleantrueWhether to render the dropdown in a portal. Set to false when used inside a Dialog or Drawer to keep it within the modal focus trap.
SelectContent.alignItemWithTriggerbooleanfalseOverlaps the trigger to align the selected item text with the trigger value.
SelectContent.sideOffsetnumber4Distance between trigger and popup.
SelectItem.showIndicatorbooleanfalseShows a check icon for the selected item.