Select React Bootstrap 5 Select React Select fields components are used for collecting user provided information from a list of options.
Info: This documentation may contain syntax introduced in the MDB5 React 4.0.0 and can be incompatible with previous versions. For old MDBSelect documentation please follow the link .
Note: Read the API tab to find all available options and advanced customization
Basic example Select fields components are used for collecting user provided information from a list of options.
Basic example of select component that allows you to choose from a number of options.
One Two Three Four Five Six Seven Eight
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Multiselect Add multiple
property to the select element to activate multiple mode.
One Two Three Four Five Six Seven Eight Example label
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Select with label It is possible to add select label by setting the label
property.
One Two Three Four Five Example label
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Select with placeholder Use placeholder
property to set placeholder for select input. The placeholder will be displayed when input is focused and no option is selected.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Disabled select Add disabled
attribute to the select component to disable select input.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Disabled options Use disabled
key on option element to disable specific option.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Custom content Custom content will be displayed at the end of the select dropdown.
One Two Three Four Five Save
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Visible options Use visibleOptions
property to change the number of options that will be displayed in the select dropdown without scrolling.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Secondary text Add secondaryText
key to the specific options to display secondary text.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Search Set search
property to enable options filtering.
One Two Three Four Five Six Seven Eight Nine Ten
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Select with search inside a modal This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Select with icons Add icon
property to the specific options to display the option icon.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Validation Set validation
option to true
to enable component validation. The validFeedback
and invalidFeedback
options allow to modify the validation messages.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Controlled value Set value
prop to control the component value. The onValueChange
event allows to handle the value change.
Single selection For a standard single selection, type of the value
should be a number.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Multi selection For a multiselect, type of the value
should be an array of numbers.
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Controlled open state Set open
property to control the component open state. The onOpen
and onClose
events allow to handle the open state change.
One Two Three Four Five Six Seven Eight
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Auto select Set autoSelect
option to true
to enable selecting on Tab press.
One Two Three Four Five Six Seven Eight
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Hidden selected option Add the first option with the hidden and selected attributes and an empty value to leave select with no selection.
One Two Three Four Five Six Seven Eight Example label
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.
Select with CSS classes In order to use select with additional CSS classes you need to place it in the div
wrapper and use CSS classes on that div. In case you use display classes like .d-lg-none
and select is not visible on page load you need to use code from this example to update label width when select became visible.
One Two Three Four Five Six Seven Eight Example label
This is a mobile version of the documentation. View this website on the desktop to copy & edit the source code of the component.