File size: 1,061 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Bredcrumb (TSX)

This component displays an array of items as a breadcrumb.
Each item should have at least a label.

## How to use

```js
import Breadcrumb from 'calypso/components/breadcrumb';

const BreadcrumbExamples = () => {
	const navigationItems = [
		{ label: 'Plugins', href: `/plugins` },
		{ label: 'Search', href: `/plugins?s=woo` },
		{ label: 'Woocommerce' },
	];

	return (
		<>
			<Breadcrumb items={ [ { label: 'Plugins' } ] } />
			<br />
			<Breadcrumb items={ navigationItems } />
			<br />
			<Breadcrumb items={ navigationItems } mobileItem="Go Back" compact />
		</>
	);
};
```

## Props

- `items` (`{ label: string; href?: string; helpBubble?: React.ReactElement; onClick?: () => void }[]`) - The Navigations items to be shown
- `compact` (`boolean`) - Displays only the previous item URL (optional)
- `mobileItem` (`{ label: string; href?: string; helpBubble?: React.ReactElement; onClick?: () => void }`) - In compact version, displays this value. If not passed defaults to "Back" and the href of the second-to-last item (optional)