react-bootstrap-breadcrumbs

    0.1.2 • Public • Published

    react-bootstrap-breadcrumbs

    Breadcrumbs for React-Router and Bootstrap

    Inspired by React Breadcrumbs

    Installation

    npm i -S react-bootstrap-breadcrumbs
    

    Example

    <Route name='items' path='/items' handler={ItemsPage}>
      <Route name='item' path=':itemId' handler={ItemPage} />
    </Route>
    
    ...
    
    function getRouteTitle(name, route, params) {
      switch(name) {
      case 'items':
        return 'Items';
      case 'item':
        return 'Item #' + params.itemId;
      }
    }
    
    render() {
      return (
        <div>
          <Breadcrumbs getTitle={getRouteTitle} />
        </div>
      );
    }
    

    Render result:

    <ol class="breadcrumbs">
      <li><a href="/items">Items</a></li>
      <li class="active">Item #42</li>
    </ol>
    

    Install

    npm i react-bootstrap-breadcrumbs

    DownloadsWeekly Downloads

    3

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • alexkuz