Select
A button that opens a list of options.
Select Default
<Select
value={value}
onValueChange={(nextValue) => {
if (nextValue !== null) setValue(nextValue);
}}
items={options}
>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
{options.map((option) => (
<SelectItem
key={option.value}
value={option.value}
label={option.label}
/>
))}
</SelectGroup>
</SelectContent>
</Select>Installation
npm install pnpm add @notion-kit/selectOr if you prefer using Shadcn primitives, use
pnpm add @notion-kit/uiExamples
Custom Options
Select Custom
<Select
items={options}
value={value}
onValueChange={(nextValue) => {
if (nextValue !== null) setValue(nextValue);
}}
>
<SelectTrigger>
<SelectValue>
<div>{selectedOption.label}</div>
</SelectValue>
</SelectTrigger>
<SelectContent>{/* SelectGroup + SelectItem */}</SelectContent>
</Select>API Reference
Select
A Select follows Base UI's composition API. Compose Select,
SelectTrigger, SelectValue, SelectContent, SelectGroup, and
SelectItem directly. Pass option data to Select with Base UI's items
prop when you want SelectValue to render item labels automatically.
Prop
Type
SelectGroup
Groups related options. Every SelectItem must be rendered inside a SelectGroup.
Prop
Type
SelectLabel
A non-interactive label used to title a group of options.
Prop
Type
SelectItem
A single selectable option.
Prop
Type