v-navigation-drawer component is what your users will utilize to navigate through the application. The navigation-drawer is pre-configured to work with or without vue-router right out the box. For the purpose of display, some examples are wrapped in a
v-card element. Within your application you will generally place the
v-navigation-drawer as a direct child of
If you are using
app property enabled, you don't need to use
absolute prop as in examples.
The navigation drawer is primarily used to house links to the pages in your application. Using
null as the starting value for its
v-model will initialize the drawer as closed on mobile and as open on desktop. It is common to pair drawers with the v-list component using the nav property.
Select your desired component from below and see the available props, slots, events and functions.
Applies position: absolute to the component.
Designates the component as part of the application layout. Used for dynamically adjusting content sizing. Components using this prop should reside outside of
v-content component to function properly. You can more information about layouts on the application page. Note: this prop automatically applies position: fixed to the layout element. You can overwrite this functionality by using the
Expands from the bottom of the screen on mobile devices
A clipped drawer rests under the application toolbar
Applies specified color to the control - it can be the name of material color (for example
purple) or css color (
rgba(255, 0, 0, 0.5)). You can find list of built in classes on the colors page.
Applies the dark theme variant to the component. You can find more information on the Material Design documentation for dark themes.
Will automatically open/close drawer when resized depending if mobile or desktop.
Disables opening of navigation drawer when route changes
Collapses the drawer to a mini-variant until hovering with the mouse
Applies position: fixed to the component.
A floating drawer has no visible container (no border-right)
Sets the height of the navigation drawer
Hides the display of the overlay.
Applies the light theme variant to the component.
Condenses navigation drawer width, also accepts the .sync modifier. With this, the drawer will re-open when clicking it
Designates the width assigned when the
mini prop is turned on
Sets the designated mobile breakpoint for the component. This will apply alternate styles for mobile devices.
Sets the overlay color.
Sets the overlay opacity.
The drawer remains visible regardless of screen size
Places the navigation drawer on the right
Specifies a v-img as the component's background.
Remove all automated state functionality (resize, mobile, route) and manually control the drawer state
Specify a custom tag used on the root element.
A temporary drawer sits above its application and uses a scrim (overlay) to darken the background
Disable mobile touch functionality
Controls whether the component is visible or hidden.
Sets the width for the component.
Below is a collection of simple to complex examples.
Navigation drawers can be customized to fit any application's design. Here we apply a custom background color and an appended content area using the append slot.
By default, a navigation drawer has a 1px right border that separates it from content. In this example we want to detach the drawer from the left side and let it float on its own. The floating property removes the right border (or left if using right).
When using the mini-variant prop, the drawer will shrink (default 80px) and hide everything inside of
v-list except the first element. In this example we use the .sync modifier that allows us to tie the expanding/contracting of the drawer programmatically.
A temporary drawer sits above its application and uses a scrim (overlay) to darken the background. This drawer behavior is mimicked by default when on mobile. Clicking outside of the drawer will cause it to close.
Navigation drawers can also be positioned on the right side of your application (or an element). This is also useful for creating a side-sheet with auxillary information that may not have any navigation links. When using RTL you must explicitly define right for your drawer.
Places the component in mini-variant mode and expands once hovered. Does not alter the content area. Width can be controlled with the mini-variant-width property.
Apply a custom background to your drawer. If you need to customize
v-img's properties you can use the img slot.
In this example we define a custom width to accommodate our nested drawer. Using
v-row we ensure that the drawer and list stack horizontally next to each other.
Ready for more? Continue reading with: