import ’./Navigation.css’

Examples

Default

Grouped nav

Grouped nav, no titles

Expanded

Expanded with subnav titles

Mixed

Expandable, third level

Horizontal

Horizontal overflow

Horizontal subnav

Horizontal subnav overflow

Nav with flyout

Nav with drilldown menu

Nav with drilldown menu level two

Nav with drilldown menu level three

Nav item icons

Docked nav

<nav class="pf-v6-c-nav pf-m-docked" aria-label="Global">
  <ul class="pf-v6-c-nav__list" role="list">
    <li class="pf-v6-c-nav__item">
      <a href="#" class="pf-v6-c-nav__link" aria-label="Cubes">
        <span class="pf-v6-c-nav__link-icon">
          <svg
            class="pf-v6-svg"
            viewBox="0 0 32 32"
            fill="currentColor"
            aria-hidden="true"
            role="img"
            width="1em"
            height="1em"
          >
            <path
              d="M12.5 12h7c.827 0 1.5-.673 1.5-1.5v-7c0-.827-.673-1.5-1.5-1.5h-7c-.827 0-1.5.673-1.5 1.5v7c0 .827.673 1.5 1.5 1.5Zm.5-8h6v6h-6V4ZM5.5 25h7c.827 0 1.5-.673 1.5-1.5v-7c0-.827-.673-1.5-1.5-1.5h-7c-.827 0-1.5.673-1.5 1.5v7c0 .827.673 1.5 1.5 1.5Zm.5-8h6v6H6v-6Zm24 12a1 1 0 0 1-1 1H3a1 1 0 0 1 0-2h26a1 1 0 0 1 1 1ZM18 16.5v7c0 .827.673 1.5 1.5 1.5h7c.827 0 1.5-.673 1.5-1.5v-7c0-.827-.673-1.5-1.5-1.5h-7c-.827 0-1.5.673-1.5 1.5Zm2 .5h6v6h-6v-6Z"
            />
          </svg>
        </span>
      </a>
    </li>
    <li class="pf-v6-c-nav__item">
      <a
        href="#"
        class="pf-v6-c-nav__link pf-m-current"
        aria-current="page"
        aria-label="Folder"
      >
        <span class="pf-v6-c-nav__link-icon">
          <svg
            class="pf-v6-svg"
            viewBox="0 0 32 32"
            fill="currentColor"
            aria-hidden="true"
            role="img"
            width="1em"
            height="1em"
          >
            <path
              d="M29.5 8H17.81l-.681-3.208A1 1 0 0 0 16.15 4h-9.3a1 1 0 0 0-.979.792L5.19 8H2.5C1.673 8 1 8.673 1 9.5v17c0 .827.673 1.5 1.5 1.5h27c.827 0 1.5-.673 1.5-1.5v-17c0-.827-.673-1.5-1.5-1.5ZM29 26H3V10h3a1 1 0 0 0 .979-.792L7.66 6h7.682l.681 3.208a1 1 0 0 0 .979.792h12v16Z"
            />
          </svg>
        </span>
      </a>
    </li>
    <li class="pf-v6-c-nav__item">
      <a href="#" class="pf-v6-c-nav__link" aria-label="Cloud">
        <span class="pf-v6-c-nav__link-icon">
          <svg
            class="pf-v6-svg"
            viewBox="0 0 32 32"
            fill="currentColor"
            aria-hidden="true"
            role="img"
            width="1em"
            height="1em"
          >
            <path
              d="M26.996 14.228c.003-.077.004-.153.004-.228 0-4.962-4.037-9-9-9-3.899 0-7.333 2.532-8.54 6.156A6.891 6.891 0 0 0 8 11c-3.859 0-7 3.14-7 7s3.141 7 7 7h17.5c3.032 0 5.5-2.467 5.5-5.5a5.456 5.456 0 0 0-4.004-5.272ZM25.5 23H8c-2.757 0-5-2.243-5-5s2.243-5 5-5a4.97 4.97 0 0 1 1.799.34 1.003 1.003 0 0 0 1.341-.735C11.796 9.357 14.682 7 18 7c3.859 0 7 3.14 7 7 0 .311-.028.615-.067.916a1.004 1.004 0 0 0 .898 1.123 3.473 3.473 0 0 1 3.17 3.461c0 1.93-1.57 3.5-3.5 3.5Z"
            />
          </svg>
        </span>
      </a>
    </li>
    <li class="pf-v6-c-nav__item">
      <a href="#" class="pf-v6-c-nav__link" aria-label="Code">
        <span class="pf-v6-c-nav__link-icon">
          <svg
            class="pf-v6-svg"
            viewBox="0 0 32 32"
            fill="currentColor"
            aria-hidden="true"
            role="img"
            width="1em"
            height="1em"
          >
            <path
              d="M9.707 9.707 3.414 16l6.293 6.293a.999.999 0 1 1-1.414 1.414l-6.646-6.646a1.501 1.501 0 0 1 0-2.121l6.646-6.646a.999.999 0 1 1 1.414 1.414Zm20.647 5.232-6.646-6.646a.999.999 0 1 0-1.414 1.414L28.587 16l-6.293 6.293a.999.999 0 1 0 1.414 1.414l6.646-6.646a1.501 1.501 0 0 0 0-2.121ZM18.121 6.022a.997.997 0 0 0-1.186.77l-3.826 18a1 1 0 1 0 1.956.416l3.826-18a1 1 0 0 0-.77-1.186Z"
            />
          </svg>
        </span>
      </a>
    </li>
  </ul>
</nav>

Documentation

Overview

The navigation system relies on several different sub-components:

  • .pf-v6-c-nav__list - default navigation list. It is the basis for both default and expandable, vertical navigation.

Accessibility

AttributeApplied toOutcome
aria-label="[landmark description]".pf-v6-c-navDescribes <nav> landmark.
aria-label="[section title]".pf-v6-c-nav__sectionDescribes a nav <section>, where a .pf-v6-c-nav__section-title is not present.
aria-labelledby="[id value of link describing subnav]".pf-v6-c-nav__subnavGives the subnav <section> landmark an accessible name by referring to the element that provides the subnav <section> landmark title.
aria-expanded="false".pf-v6-c-nav__linkIndicates that subnav section is hidden.
aria-expanded="true".pf-v6-c-nav__linkIndicates that subnav section is visible.
hidden.pf-v6-c-nav__subnavIndicates that the subnav section is hidden so that it isn’t visible in the UI and isn’t accessed by assistive technologies.
disabled.pf-v6-c-nav__scroll-buttonIndicates that a scroll button is disabled, when at the first or last item of a list. Required when disabled
aria-current="page".pf-v6-c-nav__linkIndicates the current page link. Can only occur once on page.
aria-haspopup="true".pf-v6-c-nav__linkDeclares that a nav item has a submenu.

Usage

ClassApplied toOutcome
.pf-v6-c-nav<nav>Initiates a primary nav element.
.pf-v6-c-nav__subnav<section>Initiates a subnav section.
.pf-v6-c-nav__list<ul>Initiates nav list.
.pf-v6-c-nav__item<li>Initiates nav list item.
.pf-v6-c-nav__link<a>Initiates nav list link.
.pf-v6-c-nav__link-icon<span>Initiates nav list link icon.
.pf-v6-c-nav__link-text<span>Initiates nav list link text.
.pf-v6-c-nav__section<section>Initiates a nav section element.
.pf-v6-c-nav__section-title<h1>, <h2>, <h3>, <h4>, <h5>, <h6>Initiates a nav section title.
.pf-v6-c-nav__toggle<span>Initiates the nav toggle wrapper.
.pf-v6-c-nav__toggle-icon<span>Initiates a nav toggle icon wrapper.
.pf-v6-c-nav__scroll-button<button>Initiates a nav scroll button. Required for horizontal navs
.pf-m-horizontal.pf-v6-c-navModifies nav for the horizontal variation.
.pf-m-horizontal-subnav.pf-v6-c-navModifies nav for the horizontal subnav variation.
.pf-m-docked.pf-v6-c-navModifies nav for the docked variation.
.pf-m-flyout.pf-v6-c-nav__itemModifies nav item for the flyout variation.
.pf-m-scrollable.pf-v6-c-navModifies nav for the scrollable state.
.pf-m-expanded.pf-v6-c-nav__itemModifies for the expanded state.
.pf-m-current.pf-v6-c-nav__linkModifies for the current state.
.pf-m-hover.pf-v6-c-nav__linkModifies for the hover state.

CSS variables