Select

Display a dropdown list of items.

Import

import { Select } from 'raw-ui';

Default

Types

Sizes

Selected

Controlled

Multiple

Clearable

Disabled select

Disabled option

Set parent element

API

Select

PropDescriptionTypeDefault
typeselect type'default' | 'warning' | 'error''default'
sizeselect size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'
defaultValuedefault selected value (uncontrolled)SelectValue-
valueselected value (controlled)SelectValue-
placeholderselect placeholderstring-
widthselect widthstring'100%'
disableddisable selectbooleanfalse
multiplesupport multiple selectionbooleanfalse
clearablewhether to show the clear iconbooleanfalse
strategyThe positioning strategy of popup'absolute' | 'fixed''absolute'
onChangechange event handler(value: SelectValue) => void-
getPopupContainerset the parent element of popup rendering() => HTMLElement | null-
...native propsReact.HTMLAttributes-

Select.Option

PropDescriptionTypeDefault
valueunique identification valuestring | number-
disableddisable current optionbooleanfalse
...native propsReact.HTMLAttributes-

Type

import { SelectOptionValue, SelectValue } from 'raw-ui';

SelectOptionValue

type SelectOptionValue = string | number | undefined;

SelectValue

type SelectValue = SelectOptionValue | SelectOptionValue[] | undefined;