moonstone/ Dropdown
Moonstone styled Dropdown components
import Dropdown from '@enact/moonstone/Dropdown';Members
DropdownComponent
A Moonstone Dropdown component.
By default, Dropdown maintains the state of its selected property. Supply the
defaultSelected property to control its initial value. If you wish to directly control updates
to the component, supply a value to selected at creation time and update it in response to
onSelect events.
import Dropdown from '@enact/moonstone/Dropdown';DropdownBaseComponent
A stateless Dropdown component.
import {DropdownBase} from '@enact/moonstone/Dropdown';Properties
The selection items to be displayed in the
Dropdownwhenopen.Takes either an array of strings or an array of objects. When strings, the values will be used in the generated components as the readable text. When objects, the properties will be passed onto an
Itemcomponent andchildrenas well as a uniquekeyproperty are required.Disables Dropdown and becomes non-interactive.
Called when the Dropdown is closing.
Called when the Dropdown is opening.
Called when an item is selected.
The event payload will be an object with the following members:
data- The value for the option as received in thechildrenpropselected- Number representing the selected option, 0 indexed
Displays the items.
Default: falseIndex of the selected item.
The primary title text of Dropdown. The title will be replaced if an item is selected.
The width of Dropdown.
Default: 'medium'
DropdownDecoratorHigher-Order Component
Applies Moonstone specific behaviors and functionality to DropdownBase.
import {DropdownDecorator} from '@enact/moonstone/Dropdown';Properties added to wrapped component
The initial selected index when
selectedis not defined.Displays the items.
Default: falseIndex of the selected item.