title: Responsive navbar with sidebar in vuejs ( bootstrap or bootstrap-vue )
body: <p>I am using Vue.js for my project and I have made a dashboard section but I want something that is responsive and should use bootstrap or bootstrap-vue or plain HTML, CSS.
  Attaching the pictures of the dashboard I want to have -&gt;
  <a href="https://i.stack.imgur.com/ARoKP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ARoKP.png" alt="Main dashboard desktop" /></a>
  <a href="https://i.stack.imgur.com/VlMQ3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VlMQ3.png" alt="After clicking on hamburger icon" /></a>
  <a href="https://i.stack.imgur.com/UHyZe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UHyZe.png" alt="Mobile view of the same dashboard" /></a>
  <a href="https://i.stack.imgur.com/pH9B4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pH9B4.png" alt="mobile view after pressing hamburger icon" /></a></p>
  <p>This is the post I am following
  <a href="https://stackoverflow.com/questions/57173948/vuebootstrap-b-collapse-when-sidebar-collapse-change-margin-left-content-div">vuebootstrap b-collapse: when sidebar collapse, change margin-left content div</a></p>
  <p>My code---</p>
  <pre><code>  &lt;div&gt;
  &lt;b-collapse v-model=&quot;visible&quot; id=&quot;collapse-4&quot;&gt;
    &lt;div class=&quot;sidebar scrollable-menu&quot;&gt;
      &lt;div style=&quot;height: 36%&quot;&gt;
        &lt;img
          src=&quot;../../../public/images/profile.png&quot;
          style=&quot;
            width: 70px;
            height: 70px;
            border-radius: 50%;
            margin-top: 40px;
          &quot;
        /&gt;
        &lt;h3
          style=&quot;
            font-weight: bold;
            font-size: 16px;
            margin-top: 15px;
            color: white;
          &quot;
        &gt;
          Hello {{name}}
        &lt;/h3&gt;
        &lt;button
          class=&quot;mr-2 mt-2 btn&quot;
          style=&quot;
            background-color: #595cf5;
            color: white;
            border-radius: 20px;
            font-size: 12px;
            padding: 3px 8px;
          &quot;
        &gt;
          &lt;b-link
            :to=&quot;{ path: '/dashboard/freelancer/editprofile' }&quot;
            style=&quot;background-color: #595cf5; color: white&quot;
            &gt;Edit profile&lt;/b-link
          &gt;
        &lt;/button&gt;
      &lt;/div&gt;
      &lt;div style=&quot;background-color: #3b4664; height: 65%&quot;&gt;
        &lt;ul class=&quot;ul-dash&quot;&gt;
          &lt;li&gt;
            &lt;b-link
              exact-active-class=&quot;active&quot;
              :to=&quot;{ path: '/dashboard/freelancer/' }&quot;
            &gt;
              &lt;b-icon icon=&quot;pentagon&quot; class=&quot;mr-4&quot;&gt;&lt;/b-icon&gt;Home&lt;/b-link
            &gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b-link
              exact-active-class=&quot;active&quot;
              :to=&quot;{ path: '/dashboard/freelancer/projects' }&quot;
              &gt;&lt;b-icon icon=&quot;files&quot; class=&quot;mr-4&quot;&gt;&lt;/b-icon&gt;Projects&lt;/b-link
            &gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b-link
              exact-active-class=&quot;active&quot;
              :to=&quot;{ path: '/dashboard/freelancer/invitations' }&quot;
            &gt;
              &lt;b-icon icon=&quot;person-plus&quot; class=&quot;mr-4&quot;&gt;&lt;/b-icon
              &gt;Invitations&lt;/b-link
            &gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b-link
              exact-active-class=&quot;active&quot;
              :to=&quot;{ path: '/dashboard/freelancer/transactions' }&quot;
              &gt;&lt;b-icon icon=&quot;cash&quot; class=&quot;mr-4&quot;&gt;&lt;/b-icon&gt;Transactions&lt;/b-link
            &gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b-link
              exact-active-class=&quot;active&quot;
              :to=&quot;{ path: '/dashboard/freelancer/referrals' }&quot;
              &gt;&lt;b-icon icon=&quot;people-fill&quot; class=&quot;mr-4&quot;&gt;&lt;/b-icon&gt;Referrals&lt;/b-link
            &gt;
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b-link
              exact-active-class=&quot;active&quot;
              :to=&quot;{ path: '/dashboard/freelancer/resume' }&quot;
            &gt;
              &lt;b-icon icon=&quot;file-earmark-text&quot; class=&quot;mr-4&quot;&gt;&lt;/b-icon
              &gt;Resume&lt;/b-link
            &gt;
          &lt;/li&gt;
        &lt;/ul&gt;
  
        &lt;div class=&quot;contact&quot;&gt;
          &lt;span style=&quot;color: gray&quot;&gt; Having troubles? &lt;/span&gt;
          &lt;p&gt;Contact us&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/b-collapse&gt;
  
  &lt;div class=&quot;content&quot;&gt;
    &lt;b-navbar fixed=&quot;top&quot; class=&quot;navbar&quot;&gt;
    
      &lt;b-navbar-brand href=&quot;#&quot;
        &gt;&lt;img
          src=&quot;../../../public/images/fevicon.png&quot;
          :class=&quot;visible ? null : 'collapsed'&quot;
          :aria-expanded=&quot;visible ? 'true' : 'false'&quot;
          aria-controls=&quot;collapse-4&quot;
          @click=&quot;visible = !visible&quot;
          style=&quot;
            width: 30px;
            margin-right: 10px;
            box-shadow: 1px 1px 3px #eaeaea;
            border-radius: 50%;
          &quot;
        /&gt;KickStartup
      &lt;/b-navbar-brand&gt;
      &lt;b-collapse id=&quot;nav-collapse&quot; is-nav&gt;
        &lt;!-- Right aligned nav items --&gt;
  
        &lt;b-navbar-nav class=&quot;ml-auto&quot;&gt;
          &lt;!-- &lt;b-nav-item href=&quot;#&quot; class=&quot;nav-item&quot;
            &gt;&lt;span&gt;Top 1%&lt;/span&gt;&lt;/b-nav-item
          &gt; --&gt;
  
          &lt;b-nav-item-dropdown right&gt;
            &lt;!-- Using 'button-content' slot --&gt;
            &lt;template #button-content&gt;
              &lt;img
                src=&quot;../../../public/images/profile.png&quot;
                style=&quot;width: 25px&quot;
              /&gt;
            &lt;/template&gt;
            &lt;b-dropdown-item to=&quot;/dashboard/freelancer/editprofile&quot;
              &gt;Profile&lt;/b-dropdown-item
            &gt;
            &lt;b-dropdown-item @click=&quot;logout&quot;&gt;Sign Out&lt;/b-dropdown-item&gt;
          &lt;/b-nav-item-dropdown&gt;
        &lt;/b-navbar-nav&gt;
      &lt;/b-collapse&gt;
    &lt;/b-navbar&gt;
    &lt;div class=&quot;maincontent&quot;&gt;
      &lt;router-view&gt;&lt;/router-view&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
    
  <p>CSS -</p>
  <pre><code>    .sidebar {
    position: fixed;
    background-color: #181e36;
    border-radius: 0px;
    top: 0px;
    left: 0px;
    height: 100vh;
    width: 270px;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
    padding-left: 0;
    padding-right: 0;
  }
  
  .nav-item span {
    background-color: orange;
    padding: 5px 10px;
    border-radius: 10px;
    color: white;
    margin-right: 10px;
  }
  
  .navbar {
    margin-left: 0px;
    background-color: white !important;
    box-shadow: 0px 2px 5px 2px #efefef, 0px 2px 5px 2px #efefef;
  }
  
  .collapse.show ~ .content {
    margin-left: 280px;
  }
  
  .collapse.show ~ .content .navbar {
    margin-left: 272px;
  }
  
  .content {
    margin-top: 0px;
    margin-right: 5px;
    border-radius: 15px;
  }
  
  .maincontent {
    margin-top: 60px;
  }
  .active {
    color: white !important;
  }
  
  .ul-dash li a {
    color: #aeb1ba;
  }
  
  .ul-dash {
    position: relative;
    padding-top: 20px;
    margin: -10px;
    color: lightgray;
  }
  .ul-dash li {
    text-align: start;
    display: block;
    list-style: none;
    font-size: 17px;
    margin-bottom: 20px;
  }
  
  a:hover {
    text-decoration: none;
  }
  
  .ul-dash .active::after {
    content: &quot;• &quot;; /*don't miss the space*/
    color: #595cf5;
    font-size: 20px;
    margin-left: 45px;
  }
  
  .contact {
    margin: 20px;
    margin-top: 90px;
    text-align: start;
    background-color: #181e36;
    border-radius: 15px;
    color: white;
    font-size: 13px;
    padding-top: 10px;
  }
  
  .contact p {
    margin: 0px 15px;
    padding: 5px 0 10px 0;
  }
  .contact span {
    margin-left: 15px;
  }
  </code></pre>
  <p>js -</p>
  <pre><code>  props: {},
    created() {
      HTTP.get(&quot;/freelancerdash/myprofile&quot;, {
        withCredentials: true,
      })
        .then((res) =&gt; {
          console.log(res);
          this.name = res.data.name;
        })
        .catch((errors) =&gt; {
          console.log(&quot;error hai&quot;);
        });
    },
    data() {
      return {
        visible: true,
        name: &quot;&quot;,
      };
    },
    methods: {
      ...mapActions([&quot;logout&quot;]),
    },
  </code></pre>