1.0.0 • Published 5 years ago

react-minimal-breadcrumb v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

React Minimal Breadcrumb is an easy way to generate your breadcrumbs tracks.

Instalation

Install

yarn add react-minimal-breadcrumb

or

npm i react-minimal-breadcrumb

Structure

├── node_modules
├── src
│   ├── Breadcrumb.js
│   ├── index.js
├── .editorconfig
├── .gitignore
├── .travis.yml
├── package.json
├── README.md
├── LICENCE.md
├── logo.png
└── rmb.png

How to use

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

routes.js

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;

Switch

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>

Finishing

If everything went well you will have a result as in the example below. :)

License

MIT © Romullo