woocommerce/plugins/woocommerce-admin/client/components/header
Justin Shreve 215464a592 Move Jetpack JITM messages out of the wp notice toggle, and count all child divs. (https://github.com/woocommerce/woocommerce-admin/pull/111) 2018-06-13 21:19:36 -04:00
..
README.md Set document title (https://github.com/woocommerce/woocommerce-admin/pull/79) 2018-05-24 12:03:03 -04:00
index.js Expand WP notices with header toggle (https://github.com/woocommerce/woocommerce-admin/pull/101) 2018-06-04 10:25:41 -04:00
style.scss Expand WP notices with header toggle (https://github.com/woocommerce/woocommerce-admin/pull/101) 2018-06-04 10:25:41 -04:00
wordpress-notices.js Move Jetpack JITM messages out of the wp notice toggle, and count all child divs. (https://github.com/woocommerce/woocommerce-admin/pull/111) 2018-06-13 21:19:36 -04:00

README.md

Header

A basic component for the app header. The header outputs breadcrumbs via the sections prop (required) and a toggle button to show the timeline sidebar (hidden via CSS if no applicable to the page). It also sets the document title.

How to use:

import Header from 'components/header';

render: function() {
	return (
		<Header
			sections={ [
				[ '/analytics', __( 'Analytics', 'woo-dash' ) ],
				__( 'Report Title', 'woo-dash' ),
			] }
		/>
  	);
}

Props

  • sections (required): Used to generate breadcrumbs. Accepts a single items or an array of items. To make an item a link, wrap it in an array with a relative link (example: [ '/analytics', __( 'Analytics', 'woo-dash' ) ] ).
  • onToggle (required): The toggle callback when "open sidebar" button is clicked.
  • isSidebarOpen: Boolean describing whether the sidebar is toggled visible.

Note: onToggle & isSidebarOpen are passed through the Slot call, and aren't required when using <Header /> in section components.