Dropdown
Dropdown list.
import DropdownBtn from 'patchkit-dropdown' const onSelect = consoleconst onClose = console // simple string items:const ITEMS = 'First' 'Second' 'Third'<DropdownBtn ="btn highlighted" = = =>Click to open</DropdownBtn> // custom rendering:Component { return <li>Item: thispropsobjvalue</li> }const ITEMS = Com: DropdownItem value: 1 Com: DropdownItem value: 2 Com: DropdownItem value: 3 <DropdownBtn ="btn highlighted" = = =>Click to open</DropdownBtn> // onSelect for individual items:const ITEMS = label: 'First' value: 1 console label: 'Second' value: 2 console label: 'Third' value: 3 console <DropdownBtn ="btn highlighted" =>Click to open</DropdownBtn>
You can use the dropdown directly, without the button, if you want to:
import Dropdown from 'patchkit-dropdown' <Dropdown = = = />
Styles
Use the .less file:
"node_modules/patchkit-dropdown/styles.less"