Select API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import Select from '@mui/joy/Select';
// or
import { Select } from '@mui/joy';
Component name
The nameJoySelect
can be used when providing default props or style overrides in the theme.Props
Name | Type | Default | Description |
---|---|---|---|
action | func | { current?: { focusVisible: func } } | A ref for imperative actions. It currently only supports focusVisible() action. | |
color | 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning' | string | The color of the component. It supports those theme colors that make sense for this component. | |
component | elementType | The component used for the root node. Either a string to use a HTML element or a component. | |
defaultValue | any | The default selected value. Use when the component is not controlled. | |
disabled | bool | If true , the component is disabled. | |
endDecorator | node | Trailing adornment for the select. | |
getSerializedValue | func | A function to convert the currently selected value to a string. Used to set a value of a hidden input associated with the select, so that the selected value can be posted with a form. | |
indicator | node | The indicator(*) for the select. ________________ [ value * ] ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ | |
onChange | func | Callback fired when an option is selected. | |
onClose | func | Triggered when focus leaves the menu and the menu should close. | |
placeholder | node | Text to show when there is no selected value. | |
renderValue | func | Function that customizes the rendering of the selected value. | |
size | 'sm' | 'md' | 'lg' | string | The size of the component. | |
startDecorator | node | Leading adornment for the select. | |
sx | Array<func | object | bool> | func | object | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. | |
value | any | The selected value. Set to null to deselect all options. | |
variant | 'outlined' | 'plain' | 'soft' | 'solid' | string | The variant to use. |
The
ref
is forwarded to the root element.