You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Tip:** It's a good practice to include a visually hidden placeholder ('Dashboard' in this example) for screen readers when using an icon as label.
569
569
570
+
## `<Breadcrumb.ListItem>`
571
+
572
+
A version of the `<Breadcrumb.Item>` dedicated to list views. It accepts all [`<Breadcrumb.Item>` props](#breadcrumbitem).
573
+
574
+
It is convenient for building custom breadcrumbs.
575
+
576
+
```tsx
577
+
const MyBreadcrumb = () => (
578
+
<Breadcrumb>
579
+
<Breadcrumb.ListItemresource="posts">
580
+
<Breadcrumb.EditItemresource="posts" />
581
+
<Breadcrumb.ShowItemresource="posts" />
582
+
<Breadcrumb.CreateItemresource="posts" />
583
+
</Breadcrumb.ListItem>
584
+
</Breadcrumb>
585
+
);
586
+
```
587
+
588
+
## `<Breadcrumb.CreateItem>`
589
+
590
+
A version of the `<Breadcrumb.Item>` dedicated to create views. It accepts all [`<Breadcrumb.Item>` props](#breadcrumbitem).
591
+
592
+
It is convenient for building custom breadcrumbs.
593
+
594
+
```tsx
595
+
const MyBreadcrumb = () => (
596
+
<Breadcrumb>
597
+
<Breadcrumb.ListItemresource="posts">
598
+
<Breadcrumb.EditItemresource="posts" />
599
+
<Breadcrumb.ShowItemresource="posts" />
600
+
<Breadcrumb.CreateItemresource="posts" />
601
+
</Breadcrumb.ListItem>
602
+
</Breadcrumb>
603
+
);
604
+
```
605
+
606
+
## `<Breadcrumb.EditItem>`
607
+
608
+
A version of the `<Breadcrumb.Item>` dedicated to edit views. It is convenient for building custom breadcrumbs.
609
+
610
+
It accepts all [`<Breadcrumb.Item>` props](#breadcrumbitem) and an optional `meta` prop that allows you to provide a [`meta`](https://marmelab.com/react-admin/Actions.html#meta-parameter) parameter matching the one set in the `<Edit>` component:
**Tip**: If your `<Edit>` component has a `meta` parameter but manually calls [`useDefineAppLocation`](./useDefineAppLocation.md) and provides it with the record, you don't need to set the `meta` prop on the `<Breadcrumb.EditItem>` as it will read the record from the `AppLocationContext`:
631
+
632
+
```tsx
633
+
const MyBreadcrumb = () => (
634
+
<Breadcrumb>
635
+
<Breadcrumb.ListItemresource="posts">
636
+
{/* meta are not provided here */}
637
+
<Breadcrumb.EditItemresource="posts" />
638
+
<Breadcrumb.ShowItemresource="posts" />
639
+
<Breadcrumb.CreateItemresource="posts" />
640
+
</Breadcrumb.ListItem>
641
+
</Breadcrumb>
642
+
);
643
+
644
+
const PostEdit = () => (
645
+
{/* meta are provided here */}
646
+
<EditqueryOptions={ { meta: { test: true } } }>
647
+
// ...
648
+
</Edit>
649
+
);
650
+
651
+
const PostAppLocation = () => {
652
+
const record =useRecordContext();
653
+
// Pass the current record in the app location
654
+
useDefineAppLocation('posts.edit', { record });
655
+
returnnull;
656
+
}
657
+
```
658
+
659
+
## `<Breadcrumb.ShowItem>`
660
+
661
+
A version of the `<Breadcrumb.Item>` dedicated to show views. It is convenient for building custom breadcrumbs.
662
+
663
+
It accepts all [`<Breadcrumb.Item>` props](#breadcrumbitem) and an optional `meta` prop that allows you to provide a [`meta`](https://marmelab.com/react-admin/Actions.html#meta-parameter) parameter matching the one set in the `<Show>` component:
**Tip**: If your `<Show>` component has a `meta` parameter but manually calls [`useDefineAppLocation`](./useDefineAppLocation.md) and provides it with the record, you don't need to set the `meta` prop on the `<Breadcrumb.ShowItem>` as it will read the record from the `AppLocationContext`:
685
+
686
+
```tsx
687
+
const MyBreadcrumb = () => (
688
+
<Breadcrumb>
689
+
<Breadcrumb.ListItemresource="posts">
690
+
<Breadcrumb.EditItemresource="posts" />
691
+
{/* meta are not provided here */}
692
+
<Breadcrumb.ShowItemresource="posts" />
693
+
<Breadcrumb.CreateItemresource="posts" />
694
+
</Breadcrumb.ListItem>
695
+
</Breadcrumb>
696
+
);
697
+
698
+
const PostShow = () => (
699
+
{/* meta are provided here */}
700
+
<ShowqueryOptions={ { meta: { test: true } } }>
701
+
// ...
702
+
</Show>
703
+
);
704
+
705
+
const PostAppLocation = () => {
706
+
const record =useRecordContext();
707
+
// Pass the current record in the app location
708
+
useDefineAppLocation('posts.show', { record });
709
+
returnnull;
710
+
}
711
+
```
712
+
570
713
## Admins With A Dashboard
571
714
572
715
If the app has a home page defined via the [`<Admin dashboard>`](./Admin.md#dashboard) prop, the Breadcrumb will automatically detect it and set the root of the Breadcrumb to this page.
0 commit comments