2018-05-10 18:35:55 +00:00
Header
====
2018-05-18 17:31:08 +00:00
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).
2018-05-10 18:35:55 +00:00
## How to use:
```jsx
import Header from 'components/header';
2018-05-22 15:19:56 +00:00
import { Link } from 'react-router-dom';
2018-05-10 18:35:55 +00:00
render: function() {
return (
< Header sections = { [
2018-05-22 15:19:56 +00:00
< Link to = "/analytics" > { __ ( 'Analytics', 'woo-dash' ) }</ Link > ,
2018-05-10 18:35:55 +00:00
__ ( 'Report Title', 'woo-dash' ),
] } />
);
}
```
## Props
* `sections` (required): Used to generate breadcrumbs. Accepts a single node/elemnt or an array of nodes.
2018-05-18 17:31:08 +00:00
* `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.