title: How to change bootstrap 5 default menu to off-canvas menu?
body: <p>I am creating one landing page in Bootstrap 5, where default menu should be replaced by off-canvas menu with a close icon.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;Geometry Global&lt;/title&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"&gt;
    &lt;link href="assets/css/theme.css" rel="stylesheet"&gt;
    &lt;style&gt;
    @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&amp;display=swap');
          body, h1, h2, h3, h4, h5, article, section, div, p, ul, li, ol, a {
              font-family: 'Montserrat', sans-serif;
          }
          h1{
              font-size:5.3rem;
              font-weight:900;
              line-height:0.8;
          }
          h2{
              font-size:2rem;
              font-weight:700;
          }
          body{
              max-width:1414px;
              margin:0 auto;
          }
        [x-cloak] { display: none; }
        button {vertical-align: middle;}
        input#s {border-radius: 0;border-width: 0 0 1px 0;font-size: 1.5rem;}
        input#s:focus {outline: none;box-shadow: none;}
        .search-panel-wrap {
            position: relative;
            height: 1px;
        }
        .search-panel {
            background-color: white;
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            padding: 20px 0;
            z-index: 9;
        }
    &lt;/style&gt;
    &lt;script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.8.0/dist/alpine.min.js" defer&gt;&lt;/script&gt;
    &lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body x-data="{s_open: false}"&gt;
  
  &lt;section&gt;
      &lt;div class="container border-bottom border-1 border-dark"&gt;
          &lt;div class="row py-3"&gt;
              &lt;div class="col-sm-6 col-6"&gt;
                  Geometry Global
              &lt;/div&gt;
              
              &lt;div class="col-sm-6 col-6 d-block d-sm-none"&gt;
                  &lt;div class="text-end"&gt;
                      &lt;a href=""&gt;Explore Geometry Global&lt;/a&gt;&amp;nbsp;&amp;nbsp;
                      &lt;a href=""&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"&gt; &lt;path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/&gt; &lt;/svg&gt;&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section class="sticky-top bg-white"&gt;
      &lt;nav class="navbar container navbar-expand-lg navbar-light px-0"&gt;
      &lt;div class="container-fluid"&gt;
          &lt;a class="navbar-brand" href="#"&gt;Annual Report&lt;/a&gt;
          &lt;button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation"&gt;
          &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;div class="collapse navbar-collapse" id="navbarText"&gt;
          &lt;ul class="navbar-nav me-auto mb-2 mb-lg-0"&gt;
              &lt;li class="nav-item dropdown"&gt;
              &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"&gt;
                  Reports 2020
              &lt;/a&gt;
              &lt;ul class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                  &lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Report Architecture&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;hr class="dropdown-divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Report Planning&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;hr class="dropdown-divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Report Development&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li class="nav-item dropdown"&gt;
              &lt;a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"&gt;
                  External Links
              &lt;/a&gt;
              &lt;ul class="dropdown-menu" aria-labelledby="navbarDropdown"&gt;
                  &lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;hr class="dropdown-divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;hr class="dropdown-divider"&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
          &lt;span class="navbar-text d-none d-sm-block"&gt;
              &lt;a href="#" style="display: inline-block;transform: translateY(3px);"&gt;Download Geometry Global Report&lt;/a&gt;&amp;nbsp;&amp;nbsp;
              &lt;button class="btn" id="js-toggle-sp" @click="s_open = true" x-show="s_open === false"style="padding:0;height:24px;width:24px;"&gt;
                  &lt;svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"&gt; 
                      &lt;path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/&gt; 
                  &lt;/svg&gt;
              &lt;/button&gt;
              &lt;button type="button" class="btn-close" aria-label="Close" x-show="s_open" x-cloak&gt;&lt;/button&gt;
          &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;/nav&gt;
      &lt;div class="search-panel-wrap"&gt;
          &lt;div class="search-panel" x-show="s_open" @click.away="s_open = false" x-cloak&gt;
              &lt;div class="container search-panel__wrap"&gt;
                  &lt;form action=""&gt;&lt;input class="form-control" type="text" name="s" id="s" placeholder="Type here"&gt;&lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section class="py-3" style="background-color:#F9ECE4;"&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-sm-4 align-self-center"&gt;
                  &lt;div&gt;&lt;h2&gt;STATISTICS &lt;br/&gt;2020&lt;/h2&gt;&lt;/div&gt;
                  &lt;div&gt;An annual report is a comprehensive report on a company's activities throughout the preceding year. Annual reports are intended to give shareholders and other interested people information about the company's activities and financial performance.&lt;/div&gt;
              &lt;/div&gt;
              
              &lt;div class="col-sm-8 text-center"&gt;
                  &lt;img class="img-fluid" src="https://cdn.pixabay.com/photo/2019/09/28/10/38/medical-4510408_1280.png" alt=""/&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section class="py-3"&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-sm-6 align-self-center"&gt;
                  &lt;div class="py-3"&gt;&lt;h1&gt;Gross &lt;br/&gt;Income &lt;br/&gt;2020&lt;/h1&gt;&lt;/div&gt;
                  &lt;div class="py-3"&gt;An annual report is a comprehensive report on a company's activities throughout the preceding year. Annual reports are intended to give shareholders and other interested people information about the company's activities and financial performance.&lt;/div&gt;
                  &lt;div class="py-3"&gt;This doctype is meant to help our users create various business or project proposals and help them get approved. Proposals themes can be categorised per industry.&lt;/div&gt;
              &lt;/div&gt;
              
              &lt;div class="col-sm-6"&gt;
                  &lt;div class="py-3"&gt;An annual report is a comprehensive report on a company's activities throughout the preceding year. Annual reports are intended to give shareholders and other interested people information about the company's activities and financial performance.&lt;/div&gt;
                  &lt;div class="py-3"&gt;They may be considered as grey literature. Most jurisdictions require companies to prepare and disclose annual reports, and many require the annual report to be filed at the company's registry. Companies listed on a stock exchange are also required to report at more frequent intervals (depending upon the rules of the stock exchange involved).&lt;/div&gt;
                  &lt;div class="py-3"&gt;This doctype is meant to help our users create various business or project proposals and help them get approved. Proposals themes can be categorised per industry.&lt;/div&gt;
                  
              &lt;/div&gt;
          &lt;/div&gt;
          
          &lt;div class="row py-5"&gt;
              &lt;div class="col"&gt;
                  &amp;copy; geometry global inc. 2021
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I searched some tutorial but was not able to implement close button. I need menu icon to be opened from right as a off-canvas menu with working dropdowns, Any help will be appreciated.
  Thanks.</p>