This package includes containers relating to breadcrumbs in the Garden Design System.
npm install @zendeskgarden/container-breadcrumb
This container implements the breadcrumb design pattern and can be used to build a breadcrumb component. Check out storybook for live examples.
import { BreadcrumbContainer } from '@zendeskgarden/container-breadcrumb';
<BreadcrumbContainer>
{(getContainerProps, getCurrentPageProps) => (
<div {...getContainerProps()}>
<a href="#">Home</a>
<a {...getCurrentPageProps({ href: '#' })}>Items</a>
</div>
)}
</BreadcrumbContainer>;
import { useBreadcrumb } from '@zendeskgarden/container-breadcrumb';
const Breadcrumb = () => {
const { getContainerProps, getCurrentPageProps } = useBreadcrumb();
return (
<div {...getContainerProps()}>
<a href="#">Home</a>
<a {...getCurrentPageProps({ href: '#' })}>Items</a>
</div>
);
};
See react-breadcrumbs component.