Navigation




Bread Crumbs

Default


Nav

Icon used needs to be square. Icon size is 24px by 24px.

All Nav variants' navItems accept our global Spacing (padding, margin) props for custom spacing requirements. This example uses paddingY="xxs" and margin="none" on the bold variant to show this in action!

All Nav variants' navItems accept the following props for customizing font:

  • fontSize / font_size defaults to normal, also accepts small
  • fontWeight / font_weight defaults to regular, also accepts bold and bolder

The collapsible prop allows users to create a nested, collapsible nav. Pass collapsible to any NavItem and pass that navItem any number of NavItems as children to create a collapsible nav.

The optional collapsed prop can also be used to set the default state for the collapsed nav on first render of the page. collapsed takes a boolean value that is set to true (meaning nav is collapsed) by default. Set it to false as shown here to have the nav open on first render.

Collapsible Navs optionally accept the following props:

  • collapsibleTrail / collapsible_trail, enables a vertical guideline to the left of the collapsible nav's children
  • iconRight optionally accepts an array of 2 icon values; the first is used as the default icon when the node is collapsed, the second is toggled when the node is expanded. If only 1 icon value is passed, the icon will not toggle between collapsible states.

Optionally remove the expand/collapse icon(s) from any collapsible nav item by passing "none" to the icon_right prop on that nav item.

Horizontal Nav With Extended Underline


The optional extendedUnderline/extended_underline prop can be used with the default normal variant of the horizontal orientation of the nav to extend the underline to take up the full width of the container.

Horizontal Nav With Disabled Item

Default Variant
Subtle Variant
Bold Variant

Use the disabled prop on a navItem/nav_item within a horizontal nav to set it as disabled. This will render the UI as disabled, prevent clicks and not allow for tabIndex to access the item.

Vertical Nav With Disabled Item


Use the disabled prop on a navItem/nav_item within a vertical nav to set it as disabled. This will render the UI as disabled, prevent clicks and not allow for tabIndex to access the item.

Tab Nav

This is about!
This is case studies!
This is service!
This is contacts!

The Nav kit can also be used to create dynamic tabbing. To do so, use the boolean tabbing prop as shown here.

All divs you want to use as tabs MUST have an id attached to them. To link the tab to the nav, use the required data attribute pb_tab_target on each nav/item and pass it the id of the tab you want linked to that specific nav/item. See code example below to see this in action.

Pagination

Default

  • 1
  • 3
  • 4
  • 5

  • Disclaimer

    Our Pagination kit depends on the will_paginate library. Please follow the basic will_paginate setup.

    Once you have perfomed the paginated query in your controller file you can use our kit (see code example below) instead of <%= will_paginate @users %> in your view file.

    You need to add: require "playbook/pagination_renderer" in your apps controller file.

    Note: If the total page count is 0 or 1, the Pagination kit will not be displayed as there aren't multiple pages to navigate.