Skip to content

Commit 07734a7

Browse files
committed
docs(Breadcrumbs): add readme
1 parent bccc417 commit 07734a7

File tree

2 files changed

+373
-18
lines changed

2 files changed

+373
-18
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Breadcrumbs
2+
3+
Breadcrumbs component. Can collapse breadcrumbs that cause overflow.
4+
5+
### PropTypes
6+
7+
| Name | Type | Required | Default | Description |
8+
| :----------------------- | :--------- | :------: | :------ | :--------------------------------------------------------------------------------------------------------------------------- |
9+
| items | `Array` || | Breadcrumb items array `BreadcrumbsItem[]` |
10+
| className | `String` | | | CSS class name of root element |
11+
| renderRootContent | `Function` | | | Custom render function of first item `(item: BreadcrumbsItem, isCurrent: boolean) => React.ReactNode;`) |
12+
| renderItemContent | `Function` | | | Custom render function of N+1 item `(item: BreadcrumbsItem, isCurrent: boolean, isPrevCurrent: boolean) => React.ReactNode;` |
13+
| renderItemDivider | `Function` | | | Custom render function of items separator `() => React.ReactNode;` |
14+
| lastDisplayedItemsCount | `Enum` || | Number of items to display after items collapse control: `LastDisplayedItemsCount` |
15+
| firstDisplayedItemsCount | `Enum` || | Number of items to display before items collapse control: `FirstDisplayedItemsCount` |
16+
| popupStyle | `String` | | | Style of collapsed items popup `staircase` |
17+
18+
### Examples
19+
20+
```jsx
21+
const breadcrumbs = [
22+
{
23+
title: 'What is love',
24+
},
25+
{
26+
title: "Baby don't hurt me",
27+
},
28+
{
29+
title: "Don't hurt me",
30+
},
31+
{
32+
title: 'No more',
33+
},
34+
];
35+
36+
return (
37+
<Breadcrumbs
38+
items={items}
39+
lastDisplayedItemsCount={LastDisplayedItemsCount.One}
40+
firstDisplayedItemsCount={FirstDisplayedItemsCount.One}
41+
/>
42+
);
43+
```

0 commit comments

Comments
 (0)