select
v4.9.10arrow_drop_downIf true
, the width of the popover will automatically be set according to the items inside the
menu, otherwise it will be at least the width of the select input.
The option elements to populate the select with.
Can be some MenuItem
when native
is false and option
when native
is true.
⚠️The MenuItem
elements must be direct descendants when native
is false.
The default element value. Use when the component is not controlled.
If true
, a value is displayed even if no items are selected.
In order to display a meaningful value, a function should be passed to the renderValue
prop which returns the value to be displayed when no items are selected.
You can only use it when the native
prop is false
(default).
The icon that displays the arrow.
The id
of the wrapper element or the select
elment when native
.
An Input
element; does not have to be a material-ui specific Input
.
Attributes applied to the input
element.
When native
is true
, the attributes are applied on the select
element.
The ID of an element that acts as an additional label. The Select will be labelled by the additional label and the selected value.
Props applied to the Menu
element.
If true
, value
must be an array and the menu will support multiple selections.
If true
, the component will be using a native select
element.
Callback function fired when a menu item is selected.
Callback fired when the component requests to be closed. Use in controlled mode (see open).
Callback fired when the component requests to be opened. Use in controlled mode (see open).
Control select
open state.
You can only use it when the native
prop is false
(default).
Render the selected value.
You can only use it when the native
prop is false
(default).
Props applied to the clickable div element.
The input value. Providing an empty string will select no options.
This prop is required when the native
prop is false
(default).
Set to an empty string ''
if you don’t want any of the available options to be selected.
If the value is an object it must have reference equality with the option in order to be selected. If the value is not an object, the string representation must match with the string representation of the option in order to be selected.
The variant to use.
Name | Type | Description |
---|---|---|
autoWidth | bool | If |
children | node | The option elements to populate the select with.
Can be some ⚠️The |
classes | object | Override or extend the styles applied to the component. See CSS API below for more details. |
defaultValue | any | The default element value. Use when the component is not controlled. |
displayEmpty | bool | If In order to display a meaningful value, a function should be passed to the |
IconComponent | elementType | The icon that displays the arrow. |
id | string | The |
input | element | An |
inputProps | object | Attributes applied to the |
label | node | |
labelId | string | The ID of an element that acts as an additional label. The Select will be labelled by the additional label and the selected value. |
labelWidth | number | |
MenuProps | object | Props applied to the |
multiple | bool | If |
native | bool | If |
onChange | function | The event source of the callback.
You can pull out the new value by accessing |
onClose | function | The event source of the callback. |
onOpen | function | The event source of the callback. |
open | bool | Control |
renderValue | function | The |
SelectDisplayProps | object | Props applied to the clickable div element. |
value | any | The input value. Providing an empty string will select no options.
This prop is required when the If the value is an object it must have reference equality with the option in order to be selected. If the value is not an object, the string representation must match with the string representation of the option in order to be selected. |
variant | 'filled' | 'outlined' | 'standard' | The variant to use. |
aria-label | string | |
autoFocus | bool | |
autoWidth | bool | If |
children | node | The option elements to populate the select with.
Can be some |
classes (required) | object | Override or extend the styles applied to the component. See CSS API below for more details. |
className | string | The CSS class name of the select element. |
defaultValue | any | The default element value. Use when the component is not controlled. |
disabled | bool | If |
displayEmpty | bool | If |
IconComponent (required) | elementType | The icon that displays the arrow. |
inputRef | custom | Imperative handle implementing |
labelId | string | The ID of an element that acts as an additional label. The Select will be labelled by the additional label and the selected value. |
MenuProps | object | Props applied to the |
multiple | bool | If |
name | string | Name attribute of the |
onBlur | function | |
onChange | function | The event source of the callback.
You can pull out the new value by accessing |
onClose | function | The event source of the callback. |
onFocus | function | |
onOpen | function | The event source of the callback. |
open | bool | Control |
readOnly | bool | |
renderValue | function | The |
required | bool | |
SelectDisplayProps | object | Props applied to the clickable div element. |
tabIndex | number | string | |
type | any | |
value | any | The input value. |
variant | 'standard' | 'outlined' | 'filled' | The variant to use. |