Need help with react-breadcrumbs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

svenanders
403 Stars 141 Forks ISC License 469 Commits 28 Opened issues

Description

Automatic breadcrumbs for React-Router

Services available

!
?

Need anything else?

Contributors list

React Breadcrumbs

React component use to generate a breadcrumb trail (compatible with React Router).

Installation

npm install --save react-breadcrumbs

Note: this version is only compatible with React-Router v4 and up. If you need a version that is compatible with React-Router v3 and below, use

npm install --save [email protected]

Demo

The

/demo
directory provide one example of how this package can be used. See the
/demo
for the code powering the small site.

Usage

This package exposes two components, a

 component to wrap
the entire application and a 
 component to use throughout
the different sections (e.g. 
s) within the application.

Breadcrumbs

The top-level

 component accepts the following 
props
:
  • className
    (string): A class name for the outer wrapper element.
  • hidden
    (bool): Hide the inner breadcrumbs wrapper.
  • setCrumbs
    (func): A
    function(crumbs: [Object]): [Object]
    which will be called before crumbs are rendered.
  • wrapper
    (func|class): A react component to use for the inner wrapper.

Breadcrumb

  • data
    (object): An extended location descriptor. See below...
  • hidden
    (bool): Hide an individual breadcrumb (rarely needed).

The

data
object allows any valid location descriptor key (e.g.
pathname
or
search
) as well as a
title
prop:
{
  title: 'Home', // Any valid `PropTypes.node`
  pathname: '/',
  // ... any other location descriptor values
}

The fact that the

title
can be any valid
PropTypes.node
allows for a huge amount of customization. The following values are all valid:
title: 'Home'
title: Home
title: 

Authors

This project would not have been where it is today without massive contributions from a whole lot of people (

AUTHORS
). Suport for React Router v4 support was written entirely by (
@skipjack
).

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.