Select
Use Select for one or more choices in a compact native menu. Choose Combobox when readers need to search the options.
Preview
Grouped regions and a locked choice
Choose a city from Asia Pacific or North America groups and compare a disabled administrator-selected value.
Installation
New to this Registry? Complete the base setup before continuing.
npx shadcn@latest add @neumorphism-ui/selectInstall the shared base once, then add components and their dependencies with the CLI.
Grouped regions and a locked choice
npx shadcn@latest add @neumorphism-ui/label @neumorphism-ui/selectUsage
Label Select, assign a form name, and add SelectItem options with stable values. Use SelectGroup when the choices need named groups.
"use client";
import { useId } from "react";
import { Label } from "@/components/ui/label";
import { Select, SelectItem } from "@/components/ui/select";
export default function Example() {
const id = useId();
return (
<div className="grid gap-2">
<Label htmlFor={id}>Role</Label>
<Select id={id} name="role" defaultValue="designer">
<SelectItem value="designer">Designer</SelectItem>
<SelectItem value="developer">Developer</SelectItem>
</Select>
</div>
);
}API Reference
Uses native select, optgroup, and option elements with an inset field and decorative chevron. Preserves the platform picker on mobile and native form submission.
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Select | value / defaultValue | string | string[] | — | The controlled selected value or initial uncontrolled value. |
Select | onChange | React.ChangeEventHandler<HTMLSelectElement> | — | Called when the native select value changes. |
Select | disabled / required / multiple | boolean | false | Sets native select constraints and multiple selection. |
SelectItem | valuerequired | string | number | readonly string[] | — | The value submitted by the option. |
SelectGroup | labelrequired | string | — | The label for an optgroup of options. |
Accessibility
- 01
Connect Label htmlFor to the Select id.
- 02
When the first option acts as a placeholder, combine an empty value with disabled and retain a real Label.
- 03
Because it uses native select, operating-system keyboard and mobile picker behavior is preserved.