Elevation Levels

The mtrl framework provides standard elevation levels to create consistent depth throughout your application.

Level 0
Base level for content
Level 1
For cards and elevated surfaces
Level 2
For navigation drawers
Level 3
For search bars and app bars
Level 4
For dialogs and menus
Level 5
For bottom sheets

Shadows define elevation

Shadows indicate the distance between surfaces. The larger the shadow, the greater the distance.

Primary
Secondary
Tertiary

Elevation creates hierarchy

Higher elevation increases importance and brings attention to UI elements.

Level 0
Level 1
Level 2
Level 3

Surface color and elevation

As elevation increases, surface color may shift slightly to reinforce depth.

Dynamic Elevation

Elements can change elevation in response to user interaction, providing visual feedback and reinforcing relationships.

Dynamic Elevation

Elements can change elevation in response to user interaction. Hover or click to see the elevation change.

Card
Elevation 1

Cards use elevation 1 to lift content from the background and create containment.

Dialog
Elevation 4

Dialogs use higher elevation (4) to appear above other content and focus user attention.

Navigation Bar
Elevation 2

Navigation elements use elevation 2 to separate from content but remain accessible.

Floating Action Button
Elevation 3

FABs use elevation 3 to stand out as primary actions.

Using Elevation in Code

Learn how to use elevation in your SCSS and JavaScript code.

SCSS Usage

@use 'mtrl/src/styles/abstract/config' as c;

.my-card {
  @include c.elevation(1);
  
  &:hover {
    @include c.elevation(2);
    transition: box-shadow 0.2s ease;
  }
}

JavaScript Component Usage

// Creating a component with elevation
const card = createElement({
  tag: 'div',
  class: 'elevation-1',
  // other properties...
});

// Dynamically changing elevation
element.classList.remove('mtrl-elevation-1');
element.classList.add('mtrl-elevation-3');