Display a dropdown list of items.
Basic usage.
Disable all options.
disable specified options.
Hide icon on right.
show data as a group.
Select
supports multiple values to be selected.
Use with other components.
Option
to show more text with adaptive width.
you can specify the container for drop-down box rendering.
Select.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
value | selected value | string , string[] | - | - |
initialValue | initial value | string , string[] | - | - |
placeholder | placeholder string | string | - | - |
width | css width value of select | string | - | initial |
size | select component size | NormalSizes | NormalSizes | medium |
icon | icon component | ComponentType | - | SVG Component |
pure | remove icon component | boolean | - | false |
multiple | support multiple selection | boolean | - | false |
disabled | disable current radio | boolean | - | false |
onChange | selected value | (val: string | string[]) => void | - | - |
dropdownClassName | className of dropdown menu | string | - | - |
dropdownStyle | style of dropdown menu | object | - | - |
disableMatchWidth | disable Option from follow Select width | boolean | - | false |
getPopupContainer | dropdown render parent element, the default is body | () => HTMLElement | - | - |
... | native props | HTMLAttributes | 'name', 'alt', 'className', ... | - |
Select.Option.Props
Attribute | Description | Type | Accepted values | Default |
---|---|---|---|---|
value(required) | unique ident value | string | - | - |
disabled | disable current option | boolean | - | false |
... | native props | HTMLAttributes | 'name', 'id', 'className', ... | - |
NormalSizes
type NormalSizes = 'mini' | 'small' | 'medium' | 'large'