Select
A button that opens a list to pick one option from.
A button that opens a list to pick one option from.
npm install @heroui/react
First time with HeroUI? Set it up once.
/**
* Demo from HeroUI, https://heroui.com (docs example select/default.tsx).
* Apache-2.0, Copyright 2025 NextUI Inc. Full text: https://github.com/heroui-inc/heroui/blob/main/LICENSE
* Changed for Tastebud: a default export (HeroUI's docs use named ones).
*/
import {Label, ListBox, Select} from "@heroui/react";
export default function SelectDemo() {
return (
<Select className="w-[256px]" placeholder="Select one">
<Label>State</Label>
<Select.Trigger>
<Select.Value />
<Select.Indicator />
</Select.Trigger>
<Select.Popover>
<ListBox>
<ListBox.Item id="florida" textValue="Florida">
Florida
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="delaware" textValue="Delaware">
Delaware
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="california" textValue="California">
California
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="texas" textValue="Texas">
Texas
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="new-york" textValue="New York">
New York
<ListBox.ItemIndicator />
</ListBox.Item>
<ListBox.Item id="washington" textValue="Washington">
Washington
<ListBox.ItemIndicator />
</ListBox.Item>
</ListBox>
</Select.Popover>
</Select>
);
}
Changed for this site: A default export (HeroUI's docs use named ones).