React Minimal Breadcrumb is an easy way to generate your breadcrumbs tracks.
yarn add react-minimal-breadcrumb
npm i react-minimal-breadcrumb
├── node_modules
├── src
│ ├── Breadcrumb.js
│ ├── index.js
├── .editorconfig
├── .gitignore
├── .travis.yml
├── package.json
├── README.md
├── LICENCE.md
├── logo.png
└── rmb.png
React Minimal Breadcrumb uses the react-router-dom. to use it in your project you need to include it inside the switch passing the property routes with a defined route
const Routes = [
{
route: '/',
name: 'Dashboard',
icon: 'fas fa-tachometer-alt',
page: pages.Dashboard,
},
{
route: '/users',
name: 'Users',
icon: 'fas fa-users',
page: pages.Users,
},
]
export default Routes;
With the routes defined .. now you just need to include your by passing the prop routes with the routes.
import { Switch } from 'react-router-dom';
import Breadcrumb from 'react-minimal-breadcrumb';
<Switch>
<Breadcrumb routes={routes} />
</Switch>
If everything went well you will have a result as in the example below. :)
✔ Demo
MIT © Romullo