Breadcrumbs
The <Breadcrumbs/>
component render breadcrumbs that show the user where they are in the site's hierarchy.
- Usage
- Props
Import
import { Breadcrumbs, BreadcrumbsItem } from "matro-ui";
Breadcrumbs
: The wrapper that provides context and logic to the componentsBreadcrumbsItem
: The Breadcrumbs item
Usage
Loading...
Live Editor
<Breadcrumbs divider="🚀"> <BreadcrumbsItem> <Link to="#">Home</Link> </BreadcrumbsItem> <BreadcrumbsItem> <Link to="#">Products</Link> </BreadcrumbsItem> <BreadcrumbsItem> <Link to="#">Course 1</Link> </BreadcrumbsItem> </Breadcrumbs>
Show last Divider
By default, <Breadcrumbs/>
last divider is hidden. To change this behaviour, simply add showLastDivider prop:
Loading...
Live Editor
<Breadcrumbs divider="👉" showLastDivider> {["Link1", "Link2", "Link3"].map(link => <BreadcrumbsItem key={uuid()}> <Link to={`/${link}`}>{link}</Link> </BreadcrumbsItem> )} </Breadcrumbs>
Last Active
By default, <Breadcrumbs/>
last item is inactive. To change this behaviour, simply add lastActive prop:
Loading...
Live Editor
<Breadcrumbs lastActive> <BreadcrumbsItem> <Link to="#">Link 1</Link> </BreadcrumbsItem> <BreadcrumbsItem> <Link to="#">Link 2</Link> </BreadcrumbsItem> </Breadcrumbs>
Custom Divider
<Breadcrumbs/>
default divider is "/"
. To change it set divider prop (val: any):
Loading...
Live Editor
// import { IoIosArrowForward } from "react-icons/io"; <Breadcrumbs divider={<IoIosArrowForward />}> {["Link1", "Link2", "Link3"].map(link => <BreadcrumbsItem key={uuid()}> <Link to={`/${link}`}>{link}</Link> </BreadcrumbsItem> )} </Breadcrumbs>
Props of <BreadcrumbsItem/>
:
<BreadcrumbsItem/>
:children
TypeReact.FC | React.FC[] | string | number
Props of <Breadcrumbs/>
:
<Breadcrumbs/>
:children
Description
Any possible React Children. At least one
<BreadcrumbsItem/>
is required.TypeReact.FC | React.FC[] | string | number
divider
DescriptionCustom divider.
TypeReact.FC | React.FC[] | string | number
Default"/"
showLastDivider
DescriptionShows last divider if set to true.
Typeboolean
Defaultfalse
lastActive
Description
Makes last
<BreadcrumbsItem/>
accessible.Typeboolean
Defaultfalse