Module containers structure content by grouping various elements to provide cohesive sets of information and functionality.
(Note: Module Containers have been simplified. The previous variations of Module Containers are still supported, but are deprecated and will be removed in v3.0).
Use to structure content by grouping various elements to provide cohesive sets of information and functionality.
<div class="mds-module-container"> [Your content here.] </div>
This example shows a Header placed within a module container and includes attributes establishing an accessible relationship between the two components.
mds-header--border-bottom
modifier class to restyle the Header's border and internal padding for placement within a container.To meet accessibility requirements, some additional attributes must be added to the markup to establish a relationship between the Header and module container.
id
to the mds-header__title
element.id
in an aria-labelledby
attribute on the mds-module-container
element.<div class="mds-module-container" aria-labelledby="header-id-1">
<div class="mds-header mds-header--primary mds-header--border-bottom">
<h2 class="mds-header__title" id="header-id-1"> Header Title
<div class="mds-header__title-description">
<button class="mds-button mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/mds.svg#question-circle"> </use>
</svg>
</button>
</div>
</h2>
<div class="mds-header__actions">
<button class="mds-button mds-button--secondary" type="button"> Action </button>
</div>
</div>
<section> [Your content here.] </section>
</div>
$mds-background-color-white
as their background color. If requirements call for a different background color, work with a designer to create custom styles within your product’s CSS, which utilize the MDS background color constants. <section>
element to contain your content within a module container. For example:<div class="mds-module-container">
<section class="[my-product-class]"> [Your content here.] </section>
</div>