Snippets Navbar

Pure CSS and SVG Leaf Navbar for Bootstrap 5

A navigation bar shaped like a leaf, with the menu links sitting along its midrib and the current page highlighted. On phones the leaf turns upright and the links stack down the midrib.

Bootstrap 5 No jQuery Jul 2019 2.6K views

<section class="wdw-stage">
  <div class="container" style="max-width: 1040px">
    <div class="text-center mb-4">
      <span class="wdw-eyebrow">Navigation</span>
      <h2 class="wdw-heading h3 mb-1">Leaf navbar</h2>
      <p class="wdw-muted mb-0">A menu laid along the midrib of a leaf, drawn with a single SVG.</p>
    </div>
    <nav class="lf-nav" aria-label="Leaf menu">
      <svg class="lf-svg" viewBox="0 0 640 280" aria-hidden="true" focusable="false">
        <path class="lf-stem" d="M14 150 C40 130 70 150 140 140"/>
        <circle class="lf-bud" cx="14" cy="150" r="9"/>
        <path class="lf-blade" d="M140 140 C210 20 430 6 626 140 C430 274 210 260 140 140 Z"/>
        <path class="lf-shine" d="M140 140 C210 20 430 6 626 140 Z"/>
        <g class="lf-veins">
          <path d="M140 140 H612"/>
          <path d="M215 140 L262 70M215 140 L262 210"/>
          <path d="M310 140 L360 62M310 140 L360 218"/>
          <path d="M405 140 L455 72M405 140 L455 208"/>
          <path d="M498 140 L535 90M498 140 L535 190"/>
        </g>
      </svg>
      <ul class="lf-links list-unstyled mb-0">
        <li style="left: 36.2%"><a href="#" class="lf-link is-active" aria-current="page">Home</a></li>
        <li style="left: 50.6%"><a href="#" class="lf-link">Menu</a></li>
        <li style="left: 65.4%"><a href="#" class="lf-link">About</a></li>
        <li style="left: 80.4%"><a href="#" class="lf-link">Contact</a></li>
      </ul>
    </nav>
  </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.