- Default NavPanel
- Dark NavPanel
- NavPanel Position
- Prop Table
import { NavPanel } from '@duik/it'
import NavPanel from '@duik/nav-panel'
NavPanel is a nav
container to keep you navigation items. The simplest way to implement it in your UI is to use flex containers, which you can check here (Building Layout). Don't miss full example of how to build a navigation with nav elements here.
<NavPanel> <NavLink> Nav Item </NavLink> <NavLink className="active"> Active Nav Item </NavLink> <NavLink leftEl="🚝"> With left el </NavLink> <NavLink leftEl={<Icon>love</Icon>} rightEl="3"> With left and right el </NavLink> </NavPanel> <nav class="nav-panel"> <a class="nav-link"> <span class="nav-link-text">Nav Item</span> </a> <a class="nav-link active"> <span class="nav-link-text">Active Nav Item</span> </a> <a class="nav-link"> <span class="nav-link-text"> <span class="nav-link-left-el">🚝</span>With left el </span> </a> <a class="nav-link"> <span class="nav-link-text"> <span class="nav-link-left-el"> <i class="uikon">love</i> </span>With left and right el </span> <span class="nav-link-right-el">3</span> </a> </nav> ReactHTML Snippet | |
<NavPanel> <NavLink pill> Nav Item </NavLink> <NavLink className="active" pill> Active Nav Item </NavLink> <NavLink leftEl="🚝" pill> With left el </NavLink> <NavLink leftEl={<Icon>love</Icon>} pill rightEl="3"> With left and right el </NavLink> </NavPanel> <nav class="nav-panel"> <a class="nav-link-pill"> <span class="nav-link-text">Nav Item</span> </a> <a class="nav-link-pill active"> <span class="nav-link-text">Active Nav Item</span> </a> <a class="nav-link-pill"> <span class="nav-link-text"> <span class="nav-link-left-el">🚝</span>With left el </span> </a> <a class="nav-link-pill"> <span class="nav-link-text"> <span class="nav-link-left-el"> <i class="uikon">love</i> </span>With left and right el </span> <span class="nav-link-right-el">3</span> </a> </nav> ReactHTML Snippet |
<NavPanel dark> <NavLink> Nav Item </NavLink> <NavLink className="active"> Active Nav Item </NavLink> <NavLink leftEl="🚝"> With left el </NavLink> <NavLink leftEl={<Icon>love</Icon>} rightEl="3"> With left and right el </NavLink> </NavPanel> <nav class="nav-panel-dark"> <a class="nav-link"> <span class="nav-link-text">Nav Item</span> </a> <a class="nav-link active"> <span class="nav-link-text">Active Nav Item</span> </a> <a class="nav-link"> <span class="nav-link-text"> <span class="nav-link-left-el">🚝</span>With left el </span> </a> <a class="nav-link"> <span class="nav-link-text"> <span class="nav-link-left-el"> <i class="uikon">love</i> </span>With left and right el </span> <span class="nav-link-right-el">3</span> </a> </nav> ReactHTML Snippet | |
<NavPanel dark> <NavLink pill> Nav Item </NavLink> <NavLink className="active" pill> Active Nav Item </NavLink> <NavLink leftEl="🚝" pill> With left el </NavLink> <NavLink leftEl={<Icon>love</Icon>} pill rightEl="3"> With left and right el </NavLink> </NavPanel> <nav class="nav-panel-dark"> <a class="nav-link-pill"> <span class="nav-link-text">Nav Item</span> </a> <a class="nav-link-pill active"> <span class="nav-link-text">Active Nav Item</span> </a> <a class="nav-link-pill"> <span class="nav-link-text"> <span class="nav-link-left-el">🚝</span>With left el </span> </a> <a class="nav-link-pill"> <span class="nav-link-text"> <span class="nav-link-left-el"> <i class="uikon">love</i> </span>With left and right el </span> <span class="nav-link-right-el">3</span> </a> </nav> ReactHTML Snippet |
By default, border is rendered on the right side of the container. If you are placing nav panel on the left side, add "onRight" property to render the border on the left.
<NavPanel onRight> <NavLink> Nav Item </NavLink> <NavLink className="active" secondary> Active Nav Item </NavLink> <NavLink leftEl="🚝" secondary> With left el </NavLink> <NavLink leftEl={<Icon>love</Icon>} rightEl="3" secondary> With left and right el </NavLink> </NavPanel> <nav class="nav-panel nav-panel-right"> <a class="nav-link"> <span class="nav-link-text">Nav Item</span> </a> <a class="nav-link-secondary active"> <span class="nav-link-text">Active Nav Item</span> </a> <a class="nav-link-secondary"> <span class="nav-link-text"> <span class="nav-link-left-el">🚝</span>With left el </span> </a> <a class="nav-link-secondary"> <span class="nav-link-text"> <span class="nav-link-left-el"> <i class="uikon">love</i> </span>With left and right el </span> <span class="nav-link-right-el">3</span> </a> </nav> ReactHTML Snippet |
children | Required: false |
type: React.ReactNode | |
className | Required: false |
type: string | |
className, e.g. "my-custom-styling" |
onRight | positionRight | Required: false |
type: boolean | |
Renders border on the opposite side. |
dark | Required: false |
type: boolean | |
Applies dark styling. |
...rest | Required: false |
type: any | |
Other properties are passed down to the wrapping element |