Skip to content

Select API

API reference docs for the React Select component. Learn about the props, CSS, and other APIs of this exported module.

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';
You can learn about the difference by reading this guide on minimizing bundle size.

Component name

The name JoySelect can be used when providing default props or style overrides in the theme.

Props

NameTypeDefaultDescription
actionfunc
| { 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.
componentelementType
The component used for the root node. Either a string to use a HTML element or a component.
defaultValueany
The default selected value. Use when the component is not controlled.
disabledbool
If true, the component is disabled.
endDecoratornode
Trailing adornment for the select.
getSerializedValuefunc
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.
indicatornode
The indicator(*) for the select. ________________ [ value * ] ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
onChangefunc
Callback fired when an option is selected.
onClosefunc
Triggered when focus leaves the menu and the menu should close.
placeholdernode
Text to show when there is no selected value.
renderValuefunc
Function that customizes the rendering of the selected value.
size'sm'
| 'md'
| 'lg'
| string
The size of the component.
startDecoratornode
Leading adornment for the select.
sxArray<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.
valueany
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.