Multiselect Dropdown
Multiselect Dropdown
Use when you can select multiple options from a list or to filter information.
Making a selection
By default, the dropdown displays placeholder text in the field when closed.
Clicking a closed field opens a menu of options. Each option contains a checkbox input to the left of the option text.
The menu stays open while options are being selected. The menu closes by clicking the field or outside of the dropdown.
Once options have been selected from the menu, a tag appears to the left of the text in the field containing the total number of selected options. The placeholder text can change to text that better reflects what is selected.
Selected options shift to the top of the menu in alphanumeric order.
Unlike dropdown and combo box, the menu does not close once the user makes selections. Because multiple selections are possible, the user needs to click outside of the dropdown or on the parent element to close the menu.
(From Dropdown documentation)
Parameters
Type to identify the options.
Whether the dropdown is expanded or not.
The text to be displayed in the field when no option is selected.
The options to be displayed in the dropdown menu. A map signature ensures that the keys are unique and can be used to identify the selected option. The strings associated with each key are the texts to be displayed in the dropdown menu.
The currently selected options.
Callback invoked when an option is clicked. The option key is passed as a parameter, and the callback should be used to update a remembered state with the new value.
Callback invoked when the clear selection button is clicked.
Callback invoked when the expanded state of the dropdown changes. It should be used to update a remembered state with the new value.
Callback invoked when the dropdown menu should be dismissed.
The modifier to be applied to the dropdown.
The label to be displayed above the dropdown field (optionnal).
The DropdownInteractiveState of the dropdown.
The size of the dropdown, in terms of height. Defaults to DropdownSize.Large.
The minimum number of items to be visible in the dropdown menu before the user needs to scroll. This value is used to calculate the height of the menu. Defaults to 4.
Throws
If the options map is empty.
Multiselect Dropdown
Use when you can select multiple options from a list or to filter information.
Making a selection
By default, the dropdown displays placeholder text in the field when closed.
Clicking a closed field opens a menu of options. Each option contains a checkbox input to the left of the option text.
The menu stays open while options are being selected. The menu closes by clicking the field or outside of the dropdown.
Once options have been selected from the menu, a tag appears to the left of the text in the field containing the total number of selected options. The placeholder text can change to text that better reflects what is selected.
Selected options shift to the top of the menu in alphanumeric order.
Unlike dropdown and combo box, the menu does not close once the user makes selections. Because multiple selections are possible, the user needs to click outside of the dropdown or on the parent element to close the menu.
This overload is a convenience function that uses a mutable state to manage the expanded state.
(From Dropdown documentation)
Parameters
Type to identify the options.
The text to be displayed in the field when no option is selected.
The options to be displayed in the dropdown menu. A map signature ensures that the keys are unique and can be used to identify the selected option. The strings associated with each key are the texts to be displayed in the dropdown menu.
The currently selected options.
Callback invoked when an option is clicked. The option key is passed as a parameter, and the callback should be used to update a remembered state with the new value.
Callback invoked when the clear selection button is clicked.
The modifier to be applied to the dropdown.
The label to be displayed above the dropdown field (optionnal).
The DropdownInteractiveState of the dropdown.
The size of the dropdown, in terms of height. Defaults to DropdownSize.Large.
The minimum number of items to be visible in the dropdown menu before the user needs to scroll. This value is used to calculate the height of the menu. Defaults to 4.
Throws
If the options map is empty.