Giter VIP home page Giter VIP logo

auto-breadcrumb's Introduction

AutoBreadcrumb

Auto generate breadcrumb for React Router 4.xx

Build Status npm package

Install

Use yarn

$ yarn add auto-breadcrumb

Use npm

$ npm install auto-breadcrumb --save

Example

  1. config example
  2. online demo

Usage

import breadcrumbConfig from 'auto-breadcrumb';

const Breadcrumbs = breadcrumbConfig(config);

render(<Breadcrumbs pathname={location.pathname} />, MOUNT_DOM);

Api

  1. The config
keyName type default description
staticRoutesMap Object {'/':'Home'} No params routes map to breadcrumb name
dynamicRoutesMap Object {} With params routes map to breadcrumb name
homePath String / The index path
Breadcrumb ReactComponent ul The Breadcrumb container
BreadcrumbItem ReactComponent li The Breadcrumb Item
containerProps Object {} The container props
itemProps Object {} The item props
LinkComponent ReactComponent Link The Custom LinkComponent use itemRender
notFound string 404 NotFound The custom notFound name
itemRender (name, path?) => ReactNode - You can custom everything for item display, if the param path is not given, you should render a text node(not clickable)
isDisplayInHome boolean false Is the Breadcrumb displayed on the home page
  1. The Breadcrumbs Component props
propsName type isRequire default description
pathname String Y - The full location path

License

MIT

auto-breadcrumb's People

Contributors

likun7981 avatar

Watchers

James Cloos avatar Balery Ann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.