Select

A highly customizable and flexible select component for making dropdown selections.

Usage

The Select component is built for user-friendly dropdown selections with varied styling options.

Basic Usage

A straightforward select menu with item choices.

<Select.Root defaultValue="apple">
<Select.Trigger />
<Select.Content
items={[
{
value: 'apple',
label: 'Apple',
},
{
value: 'orange',
label: 'Orange',
},
]}
></Select.Content>
</Select.Root>

Placement

You can adjust the placement of the dropdown using the placement prop.

<Select.Root defaultValue="apple">
<Select.Trigger />
<Select.Content
placement="right"
items={[
{
value: 'apple',
label: 'Apple',
},
{
value: 'orange',
label: 'Orange',
},
]}
></Select.Content>
</Select.Root>

Variants

The Select component can be styled in various visual appearances.

<Select.Root defaultValue="apple" variant="ghost">
<Select.Trigger />
<Select.Content
items={[
{
value: 'apple',
label: 'Apple',
},
{
value: 'orange',
label: 'Orange',
},
]}
></Select.Content>
</Select.Root>

Size

The Select component can be sized using size props.

<Flex>
<Select.Root size={'small'} defaultValue="apple" variant="outlined">
<Select.Trigger />
<Select.Content
items={[
{
value: 'apple',
label: 'Apple',
},
{
value: 'orange',
label: 'Orange',
},
]}
></Select.Content>
</Select.Root>
<Select.Root size={'medium'} defaultValue="apple" variant="outlined">
<Select.Trigger />
<Select.Content
items={[
{
value: 'apple',
label: 'Apple',
},
{
value: 'orange',
label: 'Orange',
},
]}
></Select.Content>
</Select.Root>
<Select.Root size={'large'} defaultValue="apple" variant="outlined">
<Select.Trigger />
<Select.Content
items={[
{
value: 'apple',
label: 'Apple',
},
{
value: 'orange',
label: 'Orange',
},
]}
></Select.Content>
</Select.Root>
</Flex>

API

Props

Root

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
variant'solid' | 'ghost' | 'outlined' | 'transparent'--
defaultValuestring--
placeholderstring--
MarginPropsToken<MarginProps>--
colorThemeAccentColor--
radiusThemeRadius--
sizeResponsive<Size>'medium'-
highContrastboolean--
shadowThemeShadow--

Trigger

PropTypeDefaultRequired

Content

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
placement'top' | 'bottom' | 'left' | 'right'--
itemsItem-Yes

Item

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
valuestring-Yes
Segmented
Previous
Slider
Next