Breadcrumb
A breadcrumb displays the current location within a hierarchy. It allows going back to states higher up in the hierarchy. <Breadcrumb>
component built with Ant Design's Breadcrumb components using the useBreadcrumb
hook.
You can refer to the source-code of the <Breadcrumb>
component to see how it is built. You can also create your custom breadcrumb component inspired by the source code.
Properties
breadcrumbProps
<Breadcrumb>
component uses the Ant Design Breadcrumb component so it can be configured with the breadcrumbProps
property.
import { List, Breadcrumb } from "@pankod/refine-antd";
export const PostList: React.FC = () => {
return (
<List
pageHeaderProps={{
breadcrumb: <Breadcrumb breadcrumbProps={{ separator: "-" }} />,
}}
>
...
</List>
);
};
showHome
If your application has a DashboardPage, the home button is shown to the top of the hierarchy by default. If you don't want to show the home button, you can set showHome
to false
.
import { List, Breadcrumb } from "@pankod/refine-antd";
export const PostList: React.FC = () => {
return (
<List
pageHeaderProps={{
breadcrumb: <Breadcrumb showHome={false} />,
}}
>
...
</List>
);
};
hideIcons
If you don't want to show the resource icons on the breadcrumb, you can set hideIcons
to true
.
import { List, Breadcrumb } from "@pankod/refine-antd";
export const PostList: React.FC = () => {
return (
<List
pageHeaderProps={{
breadcrumb: <Breadcrumb hideIcons />,
}}
>
...
</List>
);
};