File: select.md | Updated: 11/15/2025
ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors
Getting started Styling Layout Releases Resources
Overview Color Dark mode Typography Spacing Breakpoints Radius Shadows Cursors
Box Flex Grid Container Section
Text Heading Blockquote Code Em Kbd Link Quote Strong
Alert Dialog Aspect Ratio Avatar Badge Button Callout Card Checkbox Checkbox Group Checkbox Cards Context Menu Data List Dialog Dropdown Menu Hover Card Icon Button Inset Popover Progress Radio Radio Group Radio Cards Scroll Area Segmented Control Select Separator Skeleton Slider Spinner Switch Table Tabs Tab Nav Text Area Text Field Tooltip
Accessible Icon Portal Reset Slot Theme Visually Hidden
Components
Displays a list of options for the user to pick fromâtriggered by a button.
View source Report an issue View in Playground
Apple
<Select.Root defaultValue="apple">
<Select.Trigger />
<Select.Content>
<Select.Group>
<Select.Label>Fruits</Select.Label>
<Select.Item value="orange">Orange</Select.Item>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="grape" disabled>
Grape
</Select.Item>
</Select.Group>
<Select.Separator />
<Select.Group>
<Select.Label>Vegetables</Select.Label>
<Select.Item value="carrot">Carrot</Select.Item>
<Select.Item value="potato">Potato</Select.Item>
</Select.Group>
</Select.Content>
</Select.Root>
Contains all the parts of a select. It inherits props from the Select primitive Root part.
| Prop | Type | Default |
| --- | --- | --- |
| size | Responsive<"1" \| "2" \| "3"> | "2" |
The button that toggles the select. This component inherits props from the Select primitive Trigger and Value parts. It supports common margin props .
| Prop | Type | Default |
| --- | --- | --- |
| variant<br><br>Prop description | "classic" \| "surface" \| "soft" \| "ghost" | "surface" |
| color<br><br>Prop description | enum<br><br>See full type | No default value |
| radius<br><br>Prop description | "none" \| "small" \| "medium" \| "large" \| "full" | No default value |
| placeholder | string | No default value |
The component that pops out when the select is open. It inherits props from the Select.Portal primitive and Select.Content primitive parts.
| Prop | Type | Default |
| --- | --- | --- |
| variant<br><br>Prop description | "solid" \| "soft" | "solid" |
| color<br><br>Prop description | enum<br><br>See full type | No default value |
| highContrast<br><br>Prop description | boolean | No default value |
The component that contains the select items. It inherits props from the Select.Item primitive part.
Used to group multiple items. It inherits props from the Select.Group primitive
part. Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.
Used to render the label of a group, it isn't focusable using arrow keys. It inherits props from the Select.Label primitive part.
Used to visually separate items in the Select. It inherits props from the Select.Separator primitive part.
Use the size prop to control the size.
AppleAppleApple
<Flex gap="3" align="center">
<Select.Root size="1" defaultValue="apple">
<Select.Trigger />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root size="2" defaultValue="apple">
<Select.Trigger />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root size="3" defaultValue="apple">
<Select.Trigger />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
Use the variant prop on Trigger and Content to customize the visual style.
AppleAppleApple
<Flex gap="3" align="center">
<Select.Root defaultValue="apple">
<Select.Trigger variant="surface" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger variant="classic" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger variant="soft" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
Use the ghost trigger variant to render the trigger without a visually containing element. Ghost triggers behave differently in layout as they use a negative margin to optically align themselves against their siblings while maintaining their padded active and hover states.
AppleApple
<Flex gap="3" align="center">
<Select.Root defaultValue="apple">
<Select.Trigger variant="surface" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger variant="ghost" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
Use the color prop on Trigger and Content to assign a specific color value.
AppleAppleAppleApple
<Flex gap="3">
<Select.Root defaultValue="apple">
<Select.Trigger color="indigo" variant="soft" />
<Select.Content color="indigo">
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger color="cyan" variant="soft" />
<Select.Content color="cyan">
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger color="orange" variant="soft" />
<Select.Content color="orange">
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger color="crimson" variant="soft" />
<Select.Content color="crimson">
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
Use the highContrast prop on Content to increase item contrast.
AppleApple
<Flex gap="3">
<Select.Root defaultValue="apple">
<Select.Trigger color="gray" />
<Select.Content color="gray" variant="solid">
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger color="gray" />
<Select.Content color="gray" variant="solid" highContrast>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
Use the radius prop to assign a specific radius value.
AppleAppleApple
<Flex gap="3">
<Select.Root defaultValue="apple">
<Select.Trigger radius="none" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger radius="large" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
<Select.Root defaultValue="apple">
<Select.Trigger radius="full" />
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
Use the placeholder prop to create a Trigger that doesnât need an initial value.
Pick a fruit
<Select.Root>
<Select.Trigger placeholder="Pick a fruit" />
<Select.Content>
<Select.Group>
<Select.Label>Fruits</Select.Label>
<Select.Item value="orange">Orange</Select.Item>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="grape" disabled>
Grape
</Select.Item>
</Select.Group>
<Select.Separator />
<Select.Group>
<Select.Label>Vegetables</Select.Label>
<Select.Item value="carrot">Carrot</Select.Item>
<Select.Item value="potato">Potato</Select.Item>
</Select.Group>
</Select.Content>
</Select.Root>
Set position="popper" prop to position the select menu below the trigger.
Apple
<Select.Root defaultValue="apple">
<Select.Trigger />
<Select.Content position="popper">
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
When using server-side rendering, you might notice a layout shift after hydration. This is because Trigger executes client-side code to display the selected itemâs text. To avoid that layout shift, you can render it manually by mapping values.
Apple
() => {
const data = {
apple: "Apple",
orange: "Orange",
};
const [value, setValue] = React.useState("apple");
return (
<Select.Root value={value} onValueChange={setValue}>
<Select.Trigger>{data[value]}</Select.Trigger>
<Select.Content>
<Select.Item value="apple">Apple</Select.Item>
<Select.Item value="orange">Orange</Select.Item>
</Select.Content>
</Select.Root>
);
};
You can customise how Trigger renders the value by controlling its children manually. For example, you can render an icon next to the selected itemâs text.
Light
() => {
const data = {
light: { label: "Light", icon: <SunIcon /> },
dark: { label: "Dark", icon: <MoonIcon /> },
};
const [value, setValue] = React.useState("light");
return (
<Flex direction="column" maxWidth="160px">
<Select.Root value={value} onValueChange={setValue}>
<Select.Trigger>
<Flex as="span" align="center" gap="2">
{data[value].icon}
{data[value].label}
</Flex>
</Select.Trigger>
<Select.Content position="popper">
<Select.Item value="light">Light</Select.Item>
<Select.Item value="dark">Dark</Select.Item>
</Select.Content>
</Select.Root>
</Flex>
);
};
PreviousSegmented Control
NextSeparator