How to make mobile responsive navbar using vuetify
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Mastering Responsive Navigation: How to Build a Hamburger Menu with Vuetify
As a senior developer, one of the most crucial aspects of modern web development is ensuring that our applications provide an excellent experience across all devices. For front-end frameworks like Vuetify, achieving true mobile responsiveness—where navigation adapts seamlessly from a full desktop bar to a compact hamburger menu—is essential.
You are looking to transform your existing v-tabs structure into a fully responsive navigation bar that hides the main menu on small screens and reveals a hamburger icon (usually implemented via a v-navigation-drawer). This guide will walk you through the best practices and code modifications needed to achieve this professional, mobile-first layout using Vuetify.
Understanding Vuetify Responsiveness
Vuetify is built upon Material Design principles, which inherently support responsive design through its use of breakpoints. Instead of relying solely on custom CSS media queries, Vuetify provides pre-built components that handle the complex state management required for responsiveness out of the box.
To implement a hide/show mechanism, we typically leverage components like v-app-bar and v-navigation-drawer. The key is setting the appropriate screen size dependencies and ensuring that the main navigation elements collapse gracefully on smaller viewports.
Refactoring Your Navbar Component
The code snippet you provided sets up a toolbar with tabs. To achieve the desired hamburger menu behavior, we need to introduce a drawer component that toggles visibility based on screen size. We will refactor your structure to use v-app-bar as the primary container and add the necessary drawer functionality.
Here is how you can restructure your navbar.vue to implement a responsive navigation bar:
The Responsive Implementation
We will introduce a v-navigation-drawer which will slide in from the side when activated on mobile devices.
<template>
<v-app-bar
color="cyan"
dark
flat
>
<!-- Hamburger Icon for Mobile -->
<v-app-bar-nav-icon @click="drawer = !drawer" />
<v-toolbar-title>Your Dashboard</v-toolbar-title>
<v-spacer></v-spacer>
<!-- Search and More Icons (Visible on all screens) -->
<v-btn icon @click="search = !search">
<v-icon v-if="search">{{ search ? 'mdi-close' : 'mdi-magnify' }}</v-icon>
</v-btn>
<v-btn icon @click="drawer = !drawer">
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
<!-- Navigation Drawer (Hamburger Menu) -->
<v-navigation-drawer
v-model="drawer"
width="280"
persistent
>
<v-list density="dense">
<v-list-item link for="web">Web</v-list-item>
<v-list-item link for="shopping">Shopping</v-list-item>
<v-list-item link for="videos">Videos</v-list-item>
<v-list-item link for="images">Images</v-list-item>
<v-list-item link for="news">News</v-list-item>
</v-list>
<!-- You can place your v-tabs here or use them in the main view -->
</v-navigation-drawer>
</v-app-bar>
</template>
<script>
export default {
data () {
return {
drawer: false, // State for the navigation drawer
search: false, // State for search visibility
items: [
'web', 'shopping', 'videos', 'images', 'news',
],
}
},
mounted () {
// Optional: Set initial state based on screen size if needed,
// though v-navigation-drawer handles most of this automatically.
}
}
</script>
Explanation of Changes and Best Practices
- Using
v-app-bar: We replaced the outerv-cardwithv-app-bar. This component is designed specifically for top navigation bars in Vuetify, providing built-in spacing and responsiveness handling. - Hamburger Trigger (
v-app-bar-nav-icon): The icon you placed at the start of the toolbar now acts as the primary toggle button for the drawer. We bind its click event to a data property (drawer) to toggle the state. - The Drawer (
v-navigation-drawer): This is the core component that creates the side menu. By binding it withv-model="drawer", changing the boolean value automatically controls whether the drawer is open or closed. On small screens, this drawer will slide in and provide access to your navigation links, fulfilling the "hamburger menu" requirement. - Data Binding: The use of
v-forfor generating list items inside the drawer (<v-list-item link>) makes these navigation links clickable, which is essential for a functional navigation system.
Conclusion: Building Scalable Interfaces
Creating mobile-responsive interfaces with component libraries like Vuetify is highly efficient. By leveraging pre-built responsive components—like v-navigation-drawer and setting up proper state management—you drastically reduce the time spent writing complex, custom CSS media queries. This approach aligns perfectly with modern architectural principles, allowing you to focus on feature development rather than pixel-perfect layout adjustments.
If you are building larger systems, maintaining clean, modular structure is key. Just as in backend development where clear separation of concerns matters (much like how Laravel encourages organized file structures), mastering component interaction makes your front-end code cleaner and more maintainable. For deeper insights into structuring large applications, exploring patterns found on platforms like laravelcompany.com can provide valuable context for building scalable architecture across the stack.