woocommerce/plugins/woocommerce-admin/packages/components/src/dropdown-button
David Levin 36c9454e90 update woocommerce dropdown button (https://github.com/woocommerce/woocommerce-admin/pull/5906)
Co-authored-by: David Levin <davidlevin@Davids-MacBook-Pro-2.local>
2020-12-22 09:14:11 -08:00
..
stories Migrate the devdocs examples to Storybook CSF stories (https://github.com/woocommerce/woocommerce-admin/pull/5271) 2020-10-15 14:55:55 +13:00
test Align WooCommerce javascript code standards/linting/styles with WordPress core. (https://github.com/woocommerce/woocommerce-admin/pull/3674) 2020-02-14 15:23:21 +13:00
README.md Fetch component usage documentation from local README.md. 2019-09-06 11:52:18 -07:00
index.js Add @woocommerce/eslint-plugin (https://github.com/woocommerce/woocommerce-admin/pull/4714) 2020-07-28 14:32:58 +12:00
style.scss update woocommerce dropdown button (https://github.com/woocommerce/woocommerce-admin/pull/5906) 2020-12-22 09:14:11 -08:00

README.md

DropdownButton

A button useful for a launcher of a dropdown component. The button is 100% width of its container and displays single or multiple lines rendered as <span/> elments.

Usage

<Dropdown
	renderToggle={ ( { isOpen, onToggle } ) => (
		<DropdownButton
			onClick={ onToggle }
			isOpen={ isOpen }
			labels={ [ 'All Products Sold' ] }
		/>
	) }
	renderContent={ () => (
		<p>Dropdown content here</p>
	) }
/>

Props

Name Type Default Description
labels Array null (required) An array of elements to be rendered as the content of the button
isOpen Boolean null Boolean describing if the dropdown in open or not