# react-dynamic-breadcrumb

> Dynamic breadcrumbs for React.js, small and easy to use.

Latest version **0.0.7** (published 2020-01-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-dynamic-breadcrumb
pnpm add react-dynamic-breadcrumb
yarn add react-dynamic-breadcrumb
bun add react-dynamic-breadcrumb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-01-29 |
| First published | 2020-01-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | isaurssaurav |
| Maintainers | saurssaurav |
| Keywords | breadcrumb, react, reactjs, react-through, dynamic |

## Links

- npm: https://www.npmjs.com/package/react-dynamic-breadcrumb
- Repository: https://github.com/isaurssaurav/react-dynamic-breadcrumb
- Homepage: https://github.com/isaurssaurav/react-dynamic-breadcrumb#readme
- Issues: https://github.com/isaurssaurav/react-dynamic-breadcrumb/issues
- npm.io page: https://npm.io/package/react-dynamic-breadcrumb

## Dependencies (1)

- [react-through](https://npm.io/package/react-through.md) ^1.1.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2020-01-29
- 0.0.6 — 2020-01-29
- 0.0.5 — 2020-01-29
- 0.0.4 — 2020-01-29
- 0.0.3 — 2020-01-29
- 0.0.2 — 2020-01-29
- 0.0.1 — 2020-01-29

## README

# React Dynamic Breadcrumb
react-dynamic-breadcumb helps to create breadcrumb dynamically independent to routes. It is quite simple and easy to use.

Simply wrap your code around `<BreadProvider />`, add `<BreadCrumb />` where you want to dispaly breadcrumb and add `<BreadcrumbItem />` in each page.


## Demo
[Click Here](https://isaurssaurav.github.io/react-dynamic-breadcrumb)

## Installation
```
$ npm install react-dynamic-breadcumb 
```
## Usage

##### 1. Wrap your code by provider
For example:
```js
import { BreadProvider } from 'react-dynamic-breadcrumb';
import { BrowserRouter } from 'react-router-dom'; 

import "react-dynamic-breadcrumb/dist/index.css"; // or you can customize your own

ReactDOM.render(
<BrowserRouter> 
    <BreadProvider> // must be inside router
        <App />
    <BreadProvider/>
<BrowserRouter/>
, document.getElementById('root'));
```

##### 2. Add BreadCrumb where you want to show your breadcrumb
For example in header:
```js
import React from 'react';
import { Breadcrumb } from 'react-dynamic-breadcrumb';

export default function Header() {
    return (
            <Breadcrumb containerClassName="dynamic-bread-crumb" separator="<strong>/</strong>" />

    )
}
```

##### 2. Add BreadcrumbItem in page
Add BreadcrumbItem to each page.
```js
import React from 'react';
import { BreadcrumbItem } from 'react-dynamic-breadcrumb';

function Football() {
    return (
        <>
            <BreadcrumbItem to="/" >Home</BreadcrumbItem>
            <BreadcrumbItem to="/sports" >Sports</BreadcrumbItem>
            <BreadcrumbItem  >Football</BreadcrumbItem>
            This is Football page
        </>
    )
}

export default Football;
```
## Props

| Name                | Type     | Default   | Description                                                          |
| ------------------- | -------- | --------- | -------------------------------------------------------------------- |
| separator       | string / html element   |    |  **Required.**  |
| containerClassName| string |  dynamic-bread-crumb|  wrapper class outside breadcrumb. (for CSS!!)|


## LICENSE

#### [MIT](./LICENSE.md)

---
_Source: https://npm.io/package/react-dynamic-breadcrumb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
