UI.MD

Select

A dropdown select control with multiple size variants.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/select.json

Usage

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

Examples

Default

API Reference

PropTypeDefaultDescription
sizeSelectTrigger"xs" | "sm" | "default""default"Trigger height and text size.
positionSelectContent"item-aligned" | "popper""popper"Dropdown positioning strategy: item-aligned overlays the trigger like a native select, popper anchors against it like a popover.
alignSelectContent"start" | "center" | "end""center"Alignment against the trigger along the chosen side; only applies when position is popper.
value*SelectItemstring-The value submitted when the item is selected.
defaultValueSelectstring-The initially selected value for uncontrolled usage.
onValueChangeSelect(value: string) => void-Called with the new value when the selection changes. Pair with value for controlled usage.
disabledSelectbooleanfalseDisables the entire select.
disabledSelectItembooleanfalseDisables a single option.