Components
Accessible select built on React Aria, from HeroUI v3. A collapsible listbox with single and multiple selection, descriptions, grouped sections with headers and separators, disabled options, controlled value, primary/secondary variants, and full keyboard + typeahead support. Compound API: Select / Select.Trigger / Select.Value / Select.Indicator / Select.Popover + ListBox / ListBox.Item / ListBox.ItemIndicator / ListBox.Section / Header / Separator / Label / Description / FieldError.
npx shadcn@latest add https://21st.dev/r/hero_ui/heroui-selectLoading preview...
"use client"
import { Label, ListBox, Select } from "@/components/ui/heroui-select"
export default function DisabledOptions() {
return (
<div className="flex min-h-[320px] w-full items-center justify-center p-8">
<Select
className="w-[256px]"
disabledKeys={["cat", "kangaroo"]}
placeholder="Select an animal"
>
<Label>Animal</Label>
<Select.Trigger>
<Select.Value />
<Select.Indicator />
</Select.Trigger>
<Select.Popover>
<ListBox>
<ListBox.Item id="dog" textValue="Dog">
<Label>Dog</Label>
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="cat" textValue="Cat">
<Label>Cat</Label>
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="bird" textValue="Bird">
<Label>Bird</Label>
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="kangaroo" textValue="Kangaroo">
<Label>Kangaroo</Label>
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="elephant" textValue="Elephant">
<Label>Elephant</Label>
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="tiger" textValue="Tiger">
<Label>Tiger</Label>
<ListBox.ItemIndicator />
</ListBox.Item>
</ListBox>
</Select.Popover>
</Select>
</div>
)
}
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...