1.3.0 • Published 7 years ago

auto-breadcrumb v1.3.0

Weekly downloads
90
License
MIT
Repository
github
Last release
7 years ago

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
keyNametypedefaultdescription
staticRoutesMapObject{'/':'Home'}No params routes map to breadcrumb name
dynamicRoutesMapObject{}With params routes map to breadcrumb name
homePathString/The index path
BreadcrumbReactComponentulThe Breadcrumb container
BreadcrumbItemReactComponentliThe Breadcrumb Item
containerPropsObject{}The container props
itemPropsObject{}The item props
LinkComponentReactComponentLinkThe Custom LinkComponent use itemRender
notFoundstring404 NotFoundThe 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)
isDisplayInHomebooleanfalseIs the Breadcrumb displayed on the home page
  1. The Breadcrumbs Component props
propsNametypeisRequiredefaultdescription
pathnameStringY-The full location path

License

MIT

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago