2.0.0
Navigation containers are full-width menus attached to a Masthead or Site Navigation.
<header class="mds-masthead" style="position: relative;">
<div class="mds-masthead__inner">
<div class="mds-masthead__left">
<button class="mds-button mds-button--flat mds-button--flat-icon-m" type="button" role="button" data-mds-navigation-container-target="masthead-navigation-container">
<svg class="mds-icon mds-button__icon mds-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/mds.svg#menu-padless">
</use>
</svg>
<span class="mds-button__text"> Menu </span>
</button>
</div>
<div class="mds-masthead__logo-wrap">
<img class="mds-masthead__logo--wide" src="/images/components/mastheads/logos/Mstar-logo-50px.svg" alt="Product Name">
<img class="mds-masthead__logo" src="/images/components/mastheads/logos/Mstar-logo-50px.svg" alt="Product Name">
</div>
<div class="mds-masthead__right"> </div>
</div>
<div id="masthead-navigation-container" class="mds-navigation-container mds-container--black">
<p>(Your content here.)</p>
</div>
</header>
mds-container--[color]
class. See the CSS Class Reference for all available background colors. menu-padless
icon and “Menu” label to a remove
icon and “Close” label.The navigation container’s width scales responsively with the viewport.
<header class="mds-masthead" style="position: relative;">
<div class="mds-masthead__inner">
<div class="mds-masthead__left">
<button class="mds-button mds-button--flat mds-button--flat-icon-m" type="button" role="button" data-mds-navigation-container-target="masthead-navigation-container">
<svg class="mds-icon mds-button__icon mds-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/mds.svg#menu-padless">
</use>
</svg>
<span class="mds-button__text"> Menu </span>
</button>
</div>
<div class="mds-masthead__logo-wrap">
<img class="mds-masthead__logo--wide" src="/images/components/mastheads/logos/Mstar-logo-50px.svg" alt="Product Name">
<img class="mds-masthead__logo" src="/images/components/mastheads/logos/Mstar-logo-50px.svg" alt="Product Name">
</div>
<div class="mds-masthead__right"> </div>
</div>
<div id="masthead-navigation-container" class="mds-navigation-container mds-container--black">
<p>(Your content here.)</p>
</div>
</header>
Use to attach a navigation container to Site Navigation, triggered by a navigation link.
<nav class="mds-site-navigation" style="position: relative;">
<ul class="mds-site-navigation__list">
<li class="mds-site-navigation__list-item">
<div class="mds-site-navigation__list-item-inner">
<a class="mds-button mds-button--large mds-button--flat mds-site-navigation__button" href="#" role="button"> Link 1 </a>
</div>
</li>
<li class="mds-site-navigation__list-item">
<div class="mds-site-navigation__list-item-inner">
<button class="mds-button mds-button--large mds-button--flat mds-site-navigation__button" type="button" data-mds-navigation-container-target="site-nav-navigation-container-1" role="button">
<span class="mds-button__text"> Link 2 </span>
<svg class="mds-icon mds-button__icon mds-button__icon--right" aria-hidden="true">
<use xlink:href="../../icons/mds.svg#caret-down--s">
</use>
</svg>
</button>
</div>
</li>
<li class="mds-site-navigation__list-item">
<div class="mds-site-navigation__list-item-inner">
<a class="mds-button mds-button--large mds-button--flat mds-site-navigation__button" href="#" role="button"> Link 3 </a>
</div>
</li>
<li class="mds-site-navigation__list-item">
<div class="mds-site-navigation__list-item-inner">
<a class="mds-button mds-button--large mds-button--flat mds-site-navigation__button" href="#" role="button"> Link 4 </a>
</div>
</li>
</ul>
<div id="site-nav-navigation-container-1" class="mds-navigation-container mds-container--black">
<p>(Your content here.)</p>
</div>
</nav>
caret-down--s
icon in a navigation item triggering a navigation container.At small viewports, the navigation container should hide, and links should move in to the Site Navigation hidden menu.
An example of a navigation container, using mds-container--dark-gray
, triggered from a menu Button in the Masthead left controls.
(Your content here.)
An example of a navigation container with, using mds-container--light-gray
, triggered from a link in a Site Navigation.
(Your content here.)
mds-container--[color]
class. See the CSS Class Reference for all available background colors.$mds-space-inset-2-x
to set an internal padding of 16px
.mds-navigation-container
element, define typography as custom styles within your product. mds-navigation-container
does not include any default font styling.click
or hover
of the invoking element.escape
Class |
Applies to |
Outcome |
---|---|---|
|
|
Makes the navigation container visible. |
|
|
Makes the navigation container’s background white. |
|
|
Makes the navigation container’s background light gray. |
|
|
Makes the navigation container’s background dark gray. |
|
|
Makes the navigation container’s background black. |