React Select Dropdown
A glass React select dropdown for picking one option, with type-to-jump and items that drift in; for search or multi-select, use the Combobox.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/select.json
SelectuseVirtualWindowdefaultSelectLabelsVIRTUALIZE_THRESHOLD- +2 more
Using it in a form? See the react-hook-form and zod recipe.
Icons and descriptions
import { useState } from "react";
import { Select } from "@/components/sheenui/select/select";
// Package build (after the first npm release, or a packed tarball): import { Select } from "@sheenui/theme";
const Dot = ({ color }: { color: string }) => <span aria-hidden className="size-2.5 rounded-full" style={{ background: color }} />;
export function Example() {
const [value, setValue] = useState<string | null>("react");
return (
<Select
label="Framework"
items={[
{ value: "react", label: "React", description: "UI library by Meta", icon: <Dot color="#58c4dc" /> },
{ value: "vue", label: "Vue", description: "Progressive framework", icon: <Dot color="#42b883" /> },
{ value: "angular", label: "Angular", description: "Not available on your plan", disabled: true },
]}
value={value}
onValueChange={setValue}
/>
);
}Files to copy
7 folders · 16 files · 4 packages
- From
theme/src/ components/select/components/drawer/parts/sheet.tsxcomponents/spinner/hooks/{use-controllable.ts, use-latest.ts, use-media-query.ts, use-preferences.ts, use-virtual-window.ts}motion/tokens.tslib/{cn.ts, field-size.ts, form.ts, glide-highlight.tsx, group-segments.ts, page-size.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/select.jsonRegistry item: select. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Grouped
Where your data is stored.
import { Select } from "@/components/sheenui/select/select";
// Package build (after the first npm release, or a packed tarball): import { Select } from "@sheenui/theme";
export function Example() {
return (
<Select
label="Region"
placeholder="Choose a region"
items={[
{ value: "bom", label: "Mumbai", description: "ap-south-1", group: "Asia Pacific" },
{ value: "fra", label: "Frankfurt", description: "eu-central-1", group: "Europe" },
{ value: "iad", label: "Virginia", description: "us-east-1", group: "Americas" },
]}
/>
);
}Thousands of options
Above 200 options the list is windowed on its own (virtualized defaults to auto); pass virtualized to force it. Only the rows near the viewport are in the DOM, yet Home, End, PageUp, PageDown and type-ahead reach every option and screen readers still hear 'item 3,000 of 5,000'. Press End, or type 'Item 4321'.
import { Select } from "@/components/sheenui/select/select";
// Package build (after the first npm release, or a packed tarball): import { Select } from "@sheenui/theme";
const items = Array.from({ length: 5000 }, (_, i) => ({
value: String(i + 1),
label: `Item ${String(i + 1).padStart(4, "0")}`,
}));
export function Example() {
return <Select label="Item" items={items} virtualized />;
}Bottom sheet on phones
mobile='sheet' opens the list as a bottom sheet under 640px wide: a drag handle you can swipe down, a scrolling body capped at 85dvh, safe-area padding and a dimmed scrim. The default, 'popup', keeps the floating list. Press “Preview on a phone” to try it on a desktop screen (or narrow the window).
import { Select } from "@/components/sheenui/select/select";
// Package build (after the first npm release, or a packed tarball): import { Select } from "@sheenui/theme";
export function Example() {
return (
<Select
label="Region"
mobile="sheet"
items={[
{ value: "bom", label: "Mumbai", description: "ap-south-1" },
{ value: "fra", label: "Frankfurt", description: "eu-central-1" },
{ value: "iad", label: "Virginia", description: "us-east-1" },
]}
/>
);
}Props
SelectLabels keys and English defaults (3)
Keyboard
Accessibility
- A Base UI Select: the trigger is a combobox-style button with aria-expanded, the popup a listbox of options.
- label, description and error are linked to the trigger; the error is announced politely.
- name submits the value with a form. Pass aria-label when there is no visible label.
All exports on this page
Select— A glass select: opens below the trigger, supports groups, icons and descriptions, and you can type to jump to an option.VIRTUALIZE_THRESHOLD— Lists longer than this are windowed on their own (virtualized="auto"): Select, Combobox and CommandPalette.defaultSelectLabels— The English SelectLabels used when labels is omitted; a partial labels prop is merged over it.useVirtualWindow— A small windowing hook for long lists of equally tall rows.
When to use Select
- Use Select as a glass select for a short, fixed list like a sort order, a time zone preset or a billing plan, where people pick one value and the options fit in one popup. Use it as a custom select in Tailwind projects when the native dropdown cannot be styled to match the rest of the page.
- Use group, icon and description on items for a language or workspace picker, where headings, flags or a second line help people choose the right entry.
- Use error, required and name for a field inside a form, with the value submitted natively and the message linked to the trigger for screen readers.
- Skip it when the list is long enough that people want to type to find an item, or when several values can be picked. Combobox handles both, and RadioGroup suits two or three visible choices.
- Pair it with Input and Combobox in the same form, which share the className wrapper convention, and Field or react-hook-form through ref, onBlur and name.
Frequently asked questions
Related pages
67 components pages in all: browse them on All components.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .