Select

Display a dropdown list of items.

The Select contain an additional Hooks, see subsection useModal for details.

General

Basic usage.

Preview
See code
Select one

Type

Differentiate states by color.

Preview
See code
Default
Value 1
Value 2
Value 1
Value 2
Value 1
Value 2

Disabled

Disable all options.

Preview
See code
Select one

Disabled Option

disable specified options.

Preview
See code
Select one

Without Icon

Hide icon on right.

Preview
See code
Select one

Labels

show data as a group.

Preview
See code
Technologies

Divider

You can use the divider of the Select with the property divider.

Preview
See code
Technologies

Multiple

Select supports multiple values to be selected.

Preview
See code
React
Vue
Rails
Express

Multiple Without Clear

Select supports multiple values to be selected without the clear icon.

Preview
See code
React
Vue
Rails
Express

Compose

Use with other components.

Preview
See code
TypeScript

Over Width

Option to show more text with adaptive width.

Preview
See code
Truncate an overly long string
Autoscale option width when text is too long

Set parent element

you can specify the container for drop-down box rendering.

Preview
See code

APIs

Select.Props

AttributeDescriptionTypeAccepted valuesDefault
valueselected valuestring, string[]--
initialValueinitial valuestring, string[]--
placeholderplaceholder stringstring--
widthcss width value of selectstring-initial
typecurrent typeSelectTypesSelectTypesdefault
iconicon componentComponentType-SVG Component
pureremove icon componentboolean-false
multiplesupport multiple selectionboolean-false
clearableadd clear icon on multiple selection (ignored otherwise)boolean-true
disableddisable current radioboolean-false
onChangeselected value(val: string | string[]) => void --
dropdownClassNameclassName of dropdown menustring--
dropdownStylestyle of dropdown menuobject--
disableMatchWidthdisable Option from follow Select widthboolean-false
getPopupContainerdropdown render parent element, the default is body() => HTMLElement--
onDropdownVisibleChangedropdown change events(visible: boolean) => void--
refforwardRefSelectRefSelectRef-
...native propsHTMLAttributes'name', 'alt', ...-

Select.Option.Props

AttributeDescriptionTypeAccepted valuesDefault
value(required)unique ident valuestring--
disableddisable current optionboolean-false
dividerdisplay a lineboolean-false
labeldisplay a group titleboolean-false
...native propsHTMLAttributes'name', 'id', ...-

SelectRef

type SelectRef = {
  focus: () => void
  blur: () => void
  scrollTo?: (options?: ScrollToOptions) => void
}

SelectTypes

type SelectTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'
Edit this page on GitHub

Previous

Rating

Next

Slider

MADE & DESIGNED WITHBY BRUNO ANDRADE
docs background gradient blue
docs background gradient violet