Dropdown
Dropdown
Dropdowns present a list of options from which a user can select one option. A selected option can represent a value in a form, or can be used as an action to filter or sort existing content.
Only one option can be selected at a time.
By default, the dropdown displays placeholder text in the field when closed.
Clicking on a closed field opens a menu of options.
Selecting an option from the menu closes it and the selected option text replaces the placeholder text in the field and also remains as an option in place if the menu is open.
(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
The currently selected option. When not null, the option associated with this key will be displayed in the field. 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.
Callback invoked when an option is selected. The selected 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 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). NOTE: This label is provided as a convenience because its implementation may be very specific across contexts. You may need to implement your own label if the provided one does not meet your requirements.
The DropdownInteractiveState of the dropdown.
The size of the dropdown, in terms of height. Defaults to DropdownSize.Large.
Whether the dropdown should have the inline modification or not.
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.
Dropdown
Dropdowns present a list of options from which a user can select one option. A selected option can represent a value in a form, or can be used as an action to filter or sort existing content.
Only one option can be selected at a time.
By default, the dropdown displays placeholder text in the field when closed.
Clicking on a closed field opens a menu of options.
Selecting an option from the menu closes it and the selected option text replaces the placeholder text in the field and also remains as an option in place if the menu is open.
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
The currently selected option. When not null, the option associated with this key will be displayed in the field. 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.
Callback invoked when an option is selected. The selected option key is passed as a parameter, and the callback should be used to update a remembered state with the new value.
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.
Whether the dropdown should have the inline modification or not.
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.