Skip to content

Components · Select

Select

Choosing one value from a known, finite set. Radix supplies the listbox ARIA model, typeahead and focus behaviour; LUC supplies the trigger chrome — identical to Input — and the menu surface. If the list needs searching that is Combobox; if the action needs running that is CommandMenu.

Examples

Trigger and menu

One size token drives the trigger height, the type scale and the menu rhythm, so a dropdown is never hand-tuned.

Applies to every chart in the group.

Value: 1y

Placeholder shows until a venue is chosen.

Disabled controls keep their label and value.

Sizes

One size drives the trigger's height, its type scale and the menu's rhythm, so a dropdown is never hand-tuned.

sm

md

lg

A long list scrolls

The menu caps its own height and scrolls, so a hundred-option list stays inside the viewport.

Type a few letters to jump — the listbox has typeahead.

Groups, descriptions and disabled options

A group is a heading, not a nesting level. Descriptions carry the code or the unit; the label stays short.

The universe drives every downstream column.

Usage

import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "@luc/ui";
<Select value={range} onValueChange={setRange}>
  <SelectTrigger aria-label="Range">
    <SelectValue placeholder="Choose a range" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="1y">1 year</SelectItem>
  </SelectContent>
</Select>

The trigger is the tab stop and the menu owns the active option; `size` on the root drives both. Radix supplies the listbox model, the typeahead and the focus behaviour.

API

Read from the published TypeScript API, so a prop that is not listed here does not exist and a default that is listed is the one the compiler sees.

Exported symbols
ExportKindSignature
Select14 documented props({ size, children, ...props }: SelectProps) => import("@types/react").JSX.Element
SelectContent18 documented props({ className, children, size, position, sideOffset, ...props }: SelectContentProps) => import("@types/react").JSX.Element
SelectGroup1 documented propsimport("@types/react").ForwardRefExoticComponent<RadixSelect.SelectGroupProps & import("@types/react").RefAttributes<HTMLDivElement>>
SelectItem5 documented props({ className, children, description, ...props }: SelectItemProps) => import("@types/react").JSX.Element
SelectLabel1 documented props({ className, ...props }: React.ComponentPropsWithRef<typeof RadixSelect.Label>) => import("@types/react").JSX.Element
SelectRoot13 documented propsimport("@types/react").FC<RadixSelect.SelectProps>
SelectSeparator1 documented propsimport("@types/react").ForwardRefExoticComponent<RadixSelect.SelectSeparatorProps & import("@types/react").RefAttributes<HTMLDivElement>>
SelectTrigger4 documented props({ className, children, size, leadingIcon, invalid, disabled, id, ...props }: SelectTriggerProps) => import("@types/react").JSX.Element
SelectValue2 documented propsimport("@types/react").ForwardRefExoticComponent<RadixSelect.SelectValueProps & import("@types/react").RefAttributes<HTMLSpanElement>>

Select props

Type: SelectProps

Values the compiler reads from the declaration.

Select props
PropTypeDefaultNotes
autoComplete?inheritedstring | undefined—
children?inheritedReactNode—
defaultOpen?inheritedboolean | undefined—
defaultValue?inheritedstring | undefined—
dir?inheritedDirection | undefined—
disabled?inheritedboolean | undefined—
form?inheritedstring | undefined—
name?inheritedstring | undefined—
onOpenChange?inherited((open: boolean) => void) | undefined—
onValueChange?inherited((value: string) => void) | undefined—
open?inheritedboolean | undefined—
required?inheritedboolean | undefined—
size?ControlSize | undefined—Control size, shared by the trigger and the menu. Default `md`.
value?inheritedstring | undefined—
SelectContent props18 props

SelectContent props

Type: SelectContentProps

Values the compiler reads from the declaration.

SelectContent props
PropTypeDefaultNotes
align?inherited"center" | "start" | "end" | undefined—
alignOffset?inheritednumber | undefined—
arrowPadding?inheritednumber | undefined—
asChild?inheritedboolean | undefined—
avoidCollisions?inheritedboolean | undefined—
collisionBoundary?inheritedBoundary | Boundary[] | undefined—
collisionPadding?inheritednumber | Partial<Record<"top" | "right" | "bottom" | "left", number>> | undefined—
forceMount?inheritedtrue | undefined—Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
hideWhenDetached?inheritedboolean | undefined—
onCloseAutoFocus?inherited((event: Event) => void) | undefined—Event handler called when auto-focusing on close. Can be prevented.
onEscapeKeyDown?inherited((event: KeyboardEvent) => void) | undefined—Event handler called when the escape key is down. Can be prevented.
onPointerDownOutside?inherited((event: PointerDownOutsideEvent) => void) | undefined—Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. Can be prevented.
position?inherited"item-aligned" | "popper" | undefined—
side?inherited"top" | "right" | "bottom" | "left" | undefined—
sideOffset?inheritednumber | undefined—
size?ControlSize | undefined—
sticky?inherited"partial" | "always" | undefined—
updatePositionStrategy?inherited"always" | "optimized" | undefined—
SelectGroup props1 props

SelectGroup props

Type: SelectGroupProps & RefAttributes<HTMLDivElement>

Values the compiler reads from the declaration.

SelectGroup props
PropTypeDefaultNotes
asChild?inheritedboolean | undefined—
SelectItem props5 props

SelectItem props

Type: SelectItemProps

Values the compiler reads from the declaration.

SelectItem props
PropTypeDefaultNotes
asChild?inheritedboolean | undefined—
description?ReactNode—Secondary line under the main label.
disabled?inheritedboolean | undefined—
textValue?inheritedstring | undefined—
valueinheritedstring—
SelectLabel props1 props

SelectLabel props

Type: RadixSelect.SelectLabelProps & RefAttributes<HTMLDivElement>

Values the compiler reads from the declaration.

SelectLabel props
PropTypeDefaultNotes
asChild?inheritedboolean | undefined—
SelectRoot props13 props

SelectRoot props

Type: SelectProps

Values the compiler reads from the declaration.

SelectRoot props
PropTypeDefaultNotes
autoComplete?inheritedstring | undefined—
children?inheritedReactNode—
defaultOpen?inheritedboolean | undefined—
defaultValue?inheritedstring | undefined—
dir?inheritedDirection | undefined—
disabled?inheritedboolean | undefined—
form?inheritedstring | undefined—
name?inheritedstring | undefined—
onOpenChange?inherited((open: boolean) => void) | undefined—
onValueChange?inherited((value: string) => void) | undefined—
open?inheritedboolean | undefined—
required?inheritedboolean | undefined—
value?inheritedstring | undefined—
SelectSeparator props1 props

SelectSeparator props

Type: SelectSeparatorProps & RefAttributes<HTMLDivElement>

Values the compiler reads from the declaration.

SelectSeparator props
PropTypeDefaultNotes
asChild?inheritedboolean | undefined—
SelectTrigger props4 props

SelectTrigger props

Type: SelectTriggerProps

Values the compiler reads from the declaration.

SelectTrigger props
PropTypeDefaultNotes
asChild?inheritedboolean | undefined—
invalid?boolean | undefined—
leadingIcon?ReactNode—Leading icon or avatar. Decorative by default.
size?ControlSize | undefined—
SelectValue props2 props

SelectValue props

Type: SelectValueProps & RefAttributes<HTMLSpanElement>

Values the compiler reads from the declaration.

SelectValue props
PropTypeDefaultNotes
asChild?inheritedboolean | undefined—
placeholder?inheritedReactNode—

Guidelines

Do

  • Use it for one value out of a known set that a reader recognises on sight; the options stay behind one click.
  • Put the short name in `SelectItem` and the code or unit in its `description`, rather than making the label long.
  • Set `size` on the root so the trigger and the menu keep one rhythm, and `invalid` on the trigger when the form rejected the value.

Don't

  • Use a select for a list that has to be searched — that is `Combobox`; for an action that runs, that is `Command`.
  • Use `SelectItem` for navigation: it sets a value, it does not go anywhere.
  • Style the trigger's height or padding by hand: the size token exists so a dropdown matches the input beside it.

Three controls, three different jobs

Select
Pick one of a handful of known options. No search.
Combobox
Search, then pick. Long or async lists.
CommandMenu
Execute something: navigate, run, toggle.

Accessibility

Radix supplies the listbox model: Enter or Space opens, the arrow keys move the active option, Home and End jump to the ends, typeahead selects by letter and Escape closes and returns focus to the trigger. The trigger carries the accessible name, and a `placeholder` is announced only until a value is chosen.

Luc UI v1.0Selectdark theme