npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-simple-breadcrumb

v1.0.0

Published

A simple React breadcrumb component.

Readme

react-simple-breadcrumb

A simple React breadcrumb component.

Install

$ npm install react-simple-breadcrumb

Demo

https://tiush.github.io/react-simple-breadcrumb/

Or locally:

$ git clone https://github.com/TiuSh/react-simple-breadcrumb.git
$ cd react-simple-breadcrumb
$ npm install
$ npm run dev

Usage

<Breadcrumb path="any/random/path" />

will render to:

<ul class="breadcrumb">
  <li class="breadcrumb__item">
    <a href="/any">any</a>
  </li>
  <li class="breadcrumb__item">
    <a href="/any/random">random</a>
  </li>
  <li class="breadcrumb__item">
    <a href="/any/random/path">path</a>
  </li>
</ul>

Then copy the lib/breadcrumb.css, and include it in your HTML page if you want to use the default styling. Or you can directly import src/breadcrumb.scss from a SASS file. See Styling for more informations.

Options

path

required | Type: String

Path that will be used to create the breadcrumb.

pathSeparator

Type: String | Default: /

Separator used in the path. Warning: This is not the separator that will be used to render the breadcrumb. See Styling for more informations.

pathRoot

Type: String | Default: undefined

Path element that will be prepended to the breadcrumb.

getUrlFromPathSegments

Type: Function | Default: pathSegments => `/${pathSegments.join('/')}`

Internally Breadcrumb split the path in segments, and then generate <a/>s. This function is used to generate the href attribute using this function.

This function will receive one parameter, an Array of segments, and should return a string that will be inserted in <a/> href attributes.

If pathRoot prop has been set, this function will receive an empty Array as parameter for the root element.

onClick

Type: Function | Default: undefined

If this function is defined the Breadcrumb will render <span/>s instead of <a/>s and call this function when one of them is clicked.

This function will receive one parameter, an Array of segments corresponding to the element clicked.

If pathRoot prop has been set, and the root element is clicked, this function will be called with an empty Array as parameter.

className

Type: String|Object | Default: undefined

Class(es) that will be appended to the class of <ul/> tag.

Styling

The breadcrumb is fully customizable through CSS or SASS (even the path separator rendered). Here is the full HTML structure that will be rendered:

<ul class="breadcrumb">
  <li class="breadcrumb__item">
    <a href="/any">any</a>
  </li>
  <li class="breadcrumb__item">
    <a href="/any/random">random</a>
  </li>
  <li class="breadcrumb__item">
    <a href="/any/random/path">path</a>
  </li>
</ul>

SASS

The breadcrumb is originally styled using SASS. Therefor you can directly import the default style from the node_modules folder:

@import '[path_to_your_node_modules]/react-simple-breadcrumb/src/breadcrumb.scss';

// Your style

SASS file also offers the possibility to customize the default styling using variables:

$breadcrumb-separator

Type: String | Default: "\00A0" "/" "\00A0"

Customize the separator used in the rendered breadcrumb

CSS

You can copy the file lib/breadcrumb.css and simply include it in your HTML page to use the default styling. Feel free to modify this file to fit your needs.

Licence

MIT