Extended header with megamenu

Orient users to a site with lots of sections and deeper hierarchical needs.

<a class="usa-skipnav" href="#main-content">Skip to main content</a>
<section class="usa-banner" aria-label="Official government website">
  <div class="usa-accordion">
    <header class="usa-banner__header">
      <div class="usa-banner__inner">
        <div class="grid-col-auto">
          <img class="usa-banner__header-flag" src="/assets/img/us_flag_small.png" alt="U.S. flag">
        </div>
        <div class="grid-col-fill tablet:grid-col-auto">
          <p class="usa-banner__header-text">An official website of the United States government</p>
          <p class="usa-banner__header-action" aria-hidden="true">Here’s how you know</p>
        </div>
        <button class="usa-accordion__button usa-banner__button"
          aria-expanded="false" aria-controls="gov-banner">
          <span class="usa-banner__button-text">Here’s how you know</span>
        </button>
      </div>
    </header>
    <div class="usa-banner__content usa-accordion__content" id="gov-banner">
      <div class="grid-row grid-gap-lg">
        <div class="usa-banner__guidance tablet:grid-col-6">
          <img class="usa-banner__icon usa-media-block__img" src="/assets/img/icon-dot-gov.svg" role="img" alt="" aria-hidden="true">
          <div class="usa-media-block__body">
            <p>
              <strong>
                Official websites use .gov
</strong>
              <br/>
              A <strong>.gov</strong> website belongs to an official government organization in the United States.

            </p>
          </div>
        </div>
        <div class="usa-banner__guidance tablet:grid-col-6">
          <img class="usa-banner__icon usa-media-block__img" src="/assets/img/icon-https.svg" role="img" alt="" aria-hidden="true">
          <div class="usa-media-block__body">
            <p>
              <strong>
                Secure .gov websites use HTTPS
</strong>
              <br/>
              A <strong>lock</strong> (
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" width="52" height="64" viewBox="0 0 52 64" class="usa-banner__lock-image" role="img" aria-labelledby="banner-lock-title banner-lock-description" focusable="false"><title id="banner-lock-title">Lock</title><desc id="banner-lock-description">A locked padlock</desc><path fill="#000000" fill-rule="evenodd" d="M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z"/></svg></span>
) or <strong>https://</strong> means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>


  


<div class="usa-overlay"></div>
<header class="usa-header usa-header--extended"><div class="usa-navbar">
  <div class="usa-logo" id="extended-mega-logo">
    <em class="usa-logo__text"><a href="/" title="Home" aria-label="Home">Project title</a></em>
  </div>
  <button class="usa-menu-btn">Menu</button>
</div>
<nav aria-label="Primary navigation" class="usa-nav">
    <div class="usa-nav__inner"><button class="usa-nav__close"><img src="/assets/img/usa-icons/close.svg" role="img" alt="close"></button>
<ul class="usa-nav__primary usa-accordion"><li class="usa-nav__primary-item">
    <button class="usa-accordion__button usa-nav__link  usa-current" aria-expanded="false" aria-controls="extended-mega-nav-section-one"><span>Current section</span></button>
    <div id="extended-mega-nav-section-one" class="usa-nav__submenu usa-megamenu"><div class="grid-row grid-gap-4"><div class="usa-col">
              <ul class="usa-nav__submenu-list"><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li></ul>
            </div><div class="usa-col">
              <ul class="usa-nav__submenu-list"><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">A very long navigation link that goes onto two lines</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li></ul>
            </div><div class="usa-col">
              <ul class="usa-nav__submenu-list"><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li></ul>
            </div></div></div></li><li class="usa-nav__primary-item">
    <button class="usa-accordion__button usa-nav__link" aria-expanded="false" aria-controls="extended-mega-nav-section-two"><span>Section</span></button>
    <div id="extended-mega-nav-section-two" class="usa-nav__submenu usa-megamenu"><div class="grid-row grid-gap-4"><div class="usa-col">
              <ul class="usa-nav__submenu-list"><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li></ul>
            </div><div class="usa-col">
              <ul class="usa-nav__submenu-list"><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">A very long navigation link that goes onto two lines</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li></ul>
            </div><div class="usa-col">
              <ul class="usa-nav__submenu-list"><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li><li class="usa-nav__submenu-item">
                    <a href="#" class="">Navigation link</a>
                  </li></ul>
            </div></div></div></li><li class="usa-nav__primary-item">
    <a class="usa-nav__link" href="javascript:void(0)"><span>Simple link</span></a>
    </li></ul><div class="usa-nav__secondary">
  <ul class="usa-nav__secondary-links"><li class="usa-nav__secondary-item">
      <a href="">Secondary link</a>
    </li><li class="usa-nav__secondary-item">
      <a href="">Another secondary link</a>
    </li></ul><form class="usa-search usa-search--small " role="search">
  <label class="usa-sr-only" for="extended-mega-search-field-small">Search small</label>
  <input class="usa-input" id="extended-mega-search-field-small" type="search" name="search">
  <button class="usa-button" type="submit"><span class="usa-sr-only">Search</span></button>
</form>
</div>
</div>
  </nav>
</header>
<main id="main-content"></main>

Guidance

About

Like the extended header, the extended header with megamenu allows for inclusion of more sections in your horizontal navigation; it also allows you to include more links in any of your dropdowns. You can customize the header (depending on your site structure) and use it:

  • With a text or image logo
  • With or without the expandable search bar
  • With or without call-to-action buttons in place of the secondary links in the horizontal navigation

When to use the extended header with megamenu

  • Lots of sections. Use an extended header with mega menu if you have too many sections in your horizontal navigation to fit comfortably in the basic header format.
  • Secondary links or specific calls to action. It’s also useful if you’d like to include secondary links or specific calls to action in addition to the main content navigation — for example Log in and Sign up links — or if you’d like to include more than six links in any of your dropdowns.
  • Deep hierarchy. If you’d like to include more than six links in any of your dropdowns.

When to consider something else

  • Shallow hierarchy. Consider using a basic dropdown rather than a megamenu unless you need to link to a very large number of sub pages.

Using the extended header with megamenu

Package

  • Package usage: @import usa-header
  • Requires: required, global