Controls

Select

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Select

Select

A select whose field grows open into its own list.

Installation

npx shadcn@latest add ikislay/pixel-ui/select

How to use

import { Select } from "@/components/ui/select"
export function Demo() {
return (
<Select
aria-label="Theme"
options={[
{ value: "light", label: "Light" },
{ value: "dark", label: "Dark" },
{ value: "system", label: "System" },
]}
/>
)
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
options*
{ value: string; label: ReactNode; disabled?: boolean }[]

The choices, in order.

value
string

Controls the picked value. Leave it unset to let the select manage itself.

defaultValue
string

The starting pick when uncontrolled.

onValueChange
(value: string) => void

Called with the newly picked value.

placeholder
ReactNode

Shown while nothing is picked.

onFeedback
(event: "open" | "close" | "select") => void

Called at each semantic moment, for wiring sound or haptics.

className
string

Merged onto the root element.