---
title: Responsive Navigation
description: Our three Menu patterns form like Voltron into one responsive Menu plugin, which allows you to switch between patterns at different screen sizes.
video: 'dmKun75_9oc'
js:
- js/foundation.responsiveMenu.js
- js/foundation.responsiveToggle.js
---
## Responsive Menu
The Menu has some responsive CSS classes built in, which allow you to re-orient a menu on different screen sizes.
Watch this part in video
```html_example
```
---
The Menu can be augmented with one of three different plugins—dropdown menu, drilldown menu, or accordion menu. However, these patterns tend to work best on specific screen sizes.
With our responsive Menu plugin, you can apply a default pattern to a Menu, and then change that pattern on other screen sizes.
Some Menu Combination (but not limited) to are
- [Drilldown Dropdown Menu](#drilldown-dropdown-menu)
- [Accordion Dropdown Menu](#accordion-dropdown-menu)
- [Drilldown Accordion Menu](#drilldown-accordion-menu)
#### Drilldown Dropdown Menu
A drilldown menu works well on mobile, but on larger screens, you may want to convert that same menu into a dropdown. Here's an example that does just that:
Watch this part in video
```html_example
```
Bug(v6.3.1): There is a bug within drilldown-dropdown menu combo. If you set up a responsive menu with drilldown on small, then dropdown for medium up, and resize to small and then back to medium the dropdowns will not work. The bug can be reproduced here
Good News: The Bug will be fixed with the upcoming foundation release. If you are specifically using v6.3.1, we recommend to use this below patch to fix this.
```javascript
// Patch for a Bug in v6.3.1
$(window).on('changed.zf.mediaquery', function() {
$('.is-dropdown-submenu.invisible').removeClass('invisible');
});
```
#### Accordion Dropdown Menu
Same like drilldowns, an accordion menu works well on mobile, but on larger screens, you may want to convert that same menu into a dropdown. Here's an example for the same:
```html_example
```
#### Drilldown Accordion Menu
Just like foundation docs itself (see left sidenav), an accordion menu is great for a sidenav of a website on desktop, but for mobile, You might need Drilldown menu.
```html_example
```
---
## Responsive Toggle
In Foundation 5, the top bar combined this menu toggling concept into one plugin. We now have a separate, optional component you can use in tandem with the responsive plugin. It's called the title bar, and it allows you to quickly setup a menu toggle on mobile. The title bar hides itself on larger screens.
To set it up, first give your menu a unique ID. (You don't even need to use Menu! Any element will work.) Next, add a title bar with the class `.title-bar` and the attribute `data-responsive-toggle`. The value of `data-responsive-toggle` should be the ID of the menu you're toggling. Lastly, add `data-toggle` to the element that will trigger the toggle. The value of `data-toggle` should also be the ID of the menu you're toggling.
By default, the title bar will be visible on small screens, and the Menu hides. At the medium breakpoint, the title bar disappears, and the menu is always visible. This breakpoint can be changed with the `data-hide-for` attribute in HTML, or the `hideFor` setting in JavaScript.
Watch this part in video
Scale your browser down to see the toggle happen.
```html_example
```
---
## Responsive Toggle with animation
To use animations from the Motion UI library, include the data-animate="someAnimationIn someAnimationOut"
attribute.
Scale your browser down to see the toggle happen.
```html_example
```
---
### Preventing FOUC
Before the JavaScript on your page loads, you'll be able to see both the mobile and desktop element at once for a brief second. This is known as a [flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content). There's not an easy way for the framework to handle this for you, but you can add some extra CSS to account for it.
If we reference the above example, `.title-bar` is our mobile element and `.top-bar` is our desktop element. So before the JavaScript loads, we want only the right element for that screen size to be visible.
```css
.no-js .top-bar {
display: none;
}
@media screen and (min-width: 40em) {
.no-js .top-bar {
display: block;
}
.no-js .title-bar {
display: none;
}
}
```
If you're using Sass, you can write it like this:
```scss
.no-js {
@include breakpoint(small only) {
.top-bar {
display: none;
}
}
@include breakpoint(medium) {
.title-bar {
display: none;
}
}
}
```