Select

Picks one option from a list.

@paneui/theme@paneui/icons@paneui/control-size@base-ui/reactclass-variance-authority

Installation

pnpm dlx shadcn@latest add @paneui/select

Usage

Composition

Examples

Placeholder

Sizes

With Icons

Use when icons help tell the options apart.

Disabled

Controlled

Use when other UI reacts to the choice.

RTL

Positioning

By default the popup opens over the trigger with the selected item aligned to it (alignItemWithTrigger), like a native select. Set it to false to drop the list below instead.

Keyboard

Space, Enter or the arrow keys open the list. Arrow keys move, typing jumps to a matching item, Enter selects and Esc closes.

API Reference

Built on the Select primitive. Only the props this library adds or changes are listed; everything else passes through.

Select

Re-export of the primitive root. Also accepts every prop of Select.Root.

items
{ value: any; label: ReactNode }[] | Record<string, ReactNode>
Lets SelectValue show the label for the current value.
value
any
Controlled value.
defaultValue
any
Initial value when uncontrolled.
onValueChange
(value: any, eventDetails) => void
Called when an item is chosen.
multiple= false
boolean
Allow several values.
disabled= false
boolean
Disable the whole control.
PropTypeDefaultDescription
items{ value: any; label: ReactNode }[] | Record<string, ReactNode>—Lets SelectValue show the label for the current value.
valueany—Controlled value.
defaultValueany—Initial value when uncontrolled.
onValueChange(value: any, eventDetails) => void—Called when an item is chosen.
multiplebooleanfalseAllow several values.
disabledbooleanfalseDisable the whole control.

SelectTrigger

Raised button with a trailing up/down chevron. Full width with a 10rem minimum. Also accepts every prop of Select.Trigger.

size= "default"
"xs" | "sm" | "default" | "lg"
Height 24 / 28 / 32 / 36px. Defaults to the Select size, then a sized Field.
PropTypeDefaultDescription
size"xs" | "sm" | "default" | "lg""default"Height 24 / 28 / 32 / 36px. Defaults to the Select size, then a sized Field.
data-popup-open
Present while the list is open.
data-size
The resolved size.
Data attributeDescription
data-popup-openPresent while the list is open.
data-sizeThe resolved size.

SelectValue

Shows the selected label, truncated. Also accepts every prop of Select.Value.

children
ReactNode | (value: any) => ReactNode
Custom rendering of the selected value.
PropTypeDefaultDescription
childrenReactNode | (value: any) => ReactNode—Custom rendering of the selected value.
data-placeholder
Present when nothing is selected (muted text).
Data attributeDescription
data-placeholderPresent when nothing is selected (muted text).

SelectContent

Portal, positioner, popup and scrollable list with scroll arrows. Also accepts every prop of Select.Popup.

side= "bottom"
"top" | "right" | "bottom" | "left" | "inline-start" | "inline-end"
Side to open on when not aligned with the trigger.
sideOffset= 6
number
Gap from the trigger in px.
align= "center"
"start" | "center" | "end"
Alignment against the trigger.
alignItemWithTrigger= true
boolean
Overlay the trigger so the selected item sits on top of it.
PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left" | "inline-start" | "inline-end""bottom"Side to open on when not aligned with the trigger.
sideOffsetnumber6Gap from the trigger in px.
align"start" | "center" | "end""center"Alignment against the trigger.
alignItemWithTriggerbooleantrueOverlay the trigger so the selected item sits on top of it.

SelectItem

Option row with a check on the right when selected. Also accepts every prop of Select.Item.

value
any
Value chosen by this item.
disabled= false
boolean
Dim the item and skip it.
PropTypeDefaultDescription
valueany—Value chosen by this item.
disabledbooleanfalseDim the item and skip it.
data-highlighted
Present on the item under the pointer or keyboard focus.
data-selected
Present on the selected item.
Data attributeDescription
data-highlightedPresent on the item under the pointer or keyboard focus.
data-selectedPresent on the selected item.

SelectGroup

Re-export. Groups items under a SelectLabel. Also accepts every prop of Select.Group.

SelectLabel

Small muted heading for a group. Also accepts every prop of Select.GroupLabel.

SelectSeparator

Also accepts every prop of Select.Separator.