Snippets Bar

Bootstrap 5 Full-Screen Overlay Menu

A full-screen navigation overlay revealed from an animated menu button, with large numbered links that slide in, a trapped focus loop and Escape-to-close.

Bootstrap 5 No jQuery Mar 2020 2.1K views

<section class="wdw-stage">
  <div class="container" style="max-width:1040px">
    <div class="wdw-fs wdw-card is-open" id="wdwFs">
      <header class="wdw-fs-bar d-flex align-items-center justify-content-between px-3 px-md-4">
        <a href="#" class="wdw-brand fw-bold wdw-heading fs-5 text-decoration-none">Studio Ora</a>
        <button class="wdw-burger" type="button" id="wdwBurger" aria-expanded="true" aria-controls="wdwOverlay" aria-label="Close menu">
          <span></span><span></span><span></span>
        </button>
      </header>

      <div class="wdw-fs-hero d-flex flex-column justify-content-center px-4 px-md-5" id="wdwHero" inert>
        <span class="wdw-eyebrow">Full-screen menu</span>
        <h1 class="wdw-heading display-4 mt-2 mb-3">Tap the menu button<br>in the top right</h1>
        <p class="wdw-muted fs-5 mb-0" style="max-width:34rem">The navigation takes over the whole screen, with large links that slide in one by one. Press Escape to close it.</p>
      </div>

      <div class="wdw-overlay-fs wdw-aurora" id="wdwOverlay">
        <nav aria-label="Main">
          <ul class="list-unstyled mb-0">
            <li style="--i:0"><a href="#"><span class="wdw-num">01</span>Home</a></li>
            <li style="--i:1"><a href="#"><span class="wdw-num">02</span>About</a></li>
            <li style="--i:2"><a href="#"><span class="wdw-num">03</span>Work</a></li>
            <li style="--i:3"><a href="#"><span class="wdw-num">04</span>Contact</a></li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.