Component behavior
This page describes how components behave in a layout, both in relationship to the grid as well as breakpoints.
Position terminology
UI elements behave in different ways at each breakpoint range. The position of UI elements, components, and surfaces in the grid are described with the terms below.
| Position term | Definition |
|---|---|
| Above; below | The y position of an element |
| In front of; behind | The z position of an element |
| Left; right; center | The x position of an element |
| Top; bottom | The y position of an element relative to a container or screen edge |
| Vertically centered | The x and y position of an element centered relative to a container or the screen edges |
| Sticky | An element that scrolls with the UI and locks at a certain point in the scroll range |
| Floating | A fixed element positioned in front of scrolling content |
| Leading edge | The edge of a screen or layout that written content begins from. For example, in LTR languages such as English, this is usually the left edge of a screen |
| Trailing edge | The edge of a screen or layout where written content ends |
Component adaptation
Component adaptation describes changes in visual presentation (padding, size, layout, or alignment), or switching out one component for another that is better suited to the device size and use case.
Visual presentation
Visual presentation is the most common method of adaptation. This type of adaptation affects the scale and placement of content and objects on screen, as well as their relationships to each other. For example, a text list on a mobile device can adjust margins, vertical spacing, or density to better fit larger screens like tablets.
Size constraints
Material Components have minimum and maximum values for container dimensions, margins, and padding. For size constraints of each component, visit the Components section.
For example, snackbars have a maximum width of 600dp for large screens. These minimum and maximum values allow for continuous change to the component’s visual presentation as a layout expands from mobile to large screens.
When scaling a layout, components can have fixed or responsive widths within the range of size constraints.
Elements with fixed widths remain the same width regardless of a screen’s size.

Elements with responsive widths expand and contract as a screen size changes.


Don't

Caution
Internal Composition
When scaling a component, define the position and alignment of its internal elements in relationship to the container.
For example, the icon and text label within an icon button remain anchored to each other and remain centered while the button expands horizontally.

For more complex components, like app bars, internal elements can be grouped and anchored to multiple points within the container.
For example, a menu icon and logo can be grouped and anchored to the leading edge, while a search bar is anchored to the center, and action icons are anchored to the trailing edge.

2. Account picker anchored to the trailing edge of Fortnightly's app bar
A component’s internal composition should accommodate the ergonomic needs of the device on which it’s displayed. For example, a horizontally-oriented card on a mobile device can shift to a more square-shaped card on larger screens. This adaptation gives more prominence to imagery and allows for larger type styles to enhance readability.

Component swapping
As a layout changes across screen sizes, components with similar functions can also be exchanged. This makes it possible to adjust a layout for large-scale changes to the ergonomic and functional qualities of an interface.
For example, a bottom navigation bar can swap with a navigation rail on tablets, and a navigation drawer on larger screens.
Components can switch types as well. For example, a full-screen dialog on mobile can be exchanged with a simple dialog on larger screens. This component change maintains the function of the dialog, while also making use of screen space in a way that preserves a user’s context by revealing underlying content.

Some functionally-equivalent component groups are defined below.
| Component type | Mobile option | Tablet option | Laptop option |
|---|---|---|---|
| Navigation | Bottom navigation | Navigation rail | Navigation drawer |
| Navigation | Modal navigation drawer | Modal navigation drawer | Permanent navigation drawer |
| Communication | Full-screen dialog | Simple dialog | Simple dialog |
| Action | Bottom sheet | Menu | Menu |
Use caution when swapping components by ensuring that the interchangeable components are functionally equivalent. Do not, for example, swap a button for a chip. Use caution when changing between list items and cards. The component swap should always serve a functional and ergonomic purpose for the user.
Responsive patterns
The arrangement of components in a layout can also adjust with changes in screen sizes. This adaptation occurs either by repositioning the component or concealing/revealing information based on available screen space.
Reveal
Parts of the UI that are hidden by smaller screens can be revealed when additional space becomes available at larger breakpoints.




Reposition
An interface, and the components that comprise it, can reflow or reposition to take advantage of additional screen space. Repositioning is also a way to address changing ergonomics and input methods on different screen sizes.



