sandstone/ Dropdown
Sandstone styled Dropdown components
import Dropdown from '@enact/sandstone/Dropdown';Members
DropdownComponent
A Sandstone 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/sandstone/Dropdown';DropdownBaseComponent
A stateless Dropdown component.
import {DropdownBase} from '@enact/sandstone/Dropdown';Properties
The "aria-label" for the Dropdown.
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;childrenas well as a uniquekeyproperties are required.Placement of the Dropdown.
Default: 'below'Disables Dropdown, making it 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: falseText displayed in the Dropdown when nothing is selected.
The placeholder will be replaced by the selected item.
Default: 'No Selection'Index of the selected item.
The size of the Dropdown's Button component.
Default: 'small'Primary title text of the Dropdown.
Width of the Dropdown.
Default: 'medium'
DropdownDecoratorHigher-Order Component
Applies Sandstone specific behaviors and functionality to DropdownBase.
import {DropdownDecorator} from '@enact/sandstone/Dropdown';Properties added to wrapped component
The initial selected index when
selectedis not defined.Displays the items.
Default: falseIndex of the selected item.