Layout
Window size classes decide how many panes fit and which navigation to show; the spacing scale, elevation and state layers are the rest of the layout tokens.
Window size classes
Layouts adapt by class, not by device. This window is .
| Width class | Range | Typical use |
|---|---|---|
| compact | 0–599dp | One pane; a navigation bar |
| medium | 600–839dp | One pane; a collapsed navigation rail |
| expanded | 840–1199dp | Two panes; a navigation rail |
| large | 1200–1599dp | Two panes; the expanded rail |
| extra-large | 1600dp and up | Up to three panes; the expanded rail |
| Height class | Range |
|---|---|
| compact | 0–479dp |
| medium | 480–899dp |
| expanded | 900dp and up |
The breakpoints are --m3e-sys-window-* tokens and the windowBreakpoints
object. In JavaScript, observeWindowSizeClass() (custom elements) and
useWindowSizeClass() (React) report the current class. The
navigation suite switches bar and rail by it, and
the canonical layouts apply the same breakpoints
to their own width with container queries.
import { observeWindowSizeClass } from '@kyralabs/m3exp-web/elements';
observeWindowSizeClass(({ widthClass, heightClass }) => {
document.body.dataset.layout = widthClass; // 'compact' … 'extra-large'
}, { signal: new AbortController().signal });
Spacing
An 8dp-based scale (m3.material.io, 2026), from 0 to 72dp, as
--m3e-sys-space-<step>. Compose has no spacing tokens at the pinned version.
-
space-00dp -
space-252dp -
space-504dp -
space-756dp -
space-1008dp -
space-12510dp -
space-15012dp -
space-17514dp -
space-20016dp -
space-25020dp -
space-30024dp -
space-40032dp -
space-45036dp -
space-50040dp -
space-60048dp -
space-70056dp -
space-80064dp -
space-90072dp
Elevation
Six levels, drawn as two-layer shadows in the shadow color role
(--m3e-sys-elevation-levelN-shadow). Surfaces show depth through their container
tone too; surface tint is not applied.
- level0 0dp
- level1 1dp
- level2 3dp
- level3 6dp
- level4 8dp
- level5 12dp
State layers
Interactive elements lay a translucent layer of their content color over themselves: these
opacities for each state, and a ripple from the press point. The focus ring is separate:
3dp in the secondary role,
2dp outside the component.
| State | Opacity | Token |
|---|---|---|
| hover | 0.08 |
--m3e-sys-state-hover-state-layer-opacity
|
| focus | 0.1 |
--m3e-sys-state-focus-state-layer-opacity
|
| pressed | 0.1 |
--m3e-sys-state-pressed-state-layer-opacity
|
| dragged | 0.16 |
--m3e-sys-state-dragged-state-layer-opacity
|
Sources
-
Window size classes: androidx window-core
WindowSizeClass.ktL146–161 at the pinned commit (FOUNDATIONS_SPEC §9); pane counts: m3.material.io Breakpoints and ComposecalculatePaneScaffoldDirective. - Spacing: the m3.material.io token database (
md.sys.measurement.space*). -
Elevation:
ElevationTokens.ktL24–40; shadows from Material Web 2.5.0. State layers:StateTokens.ktL22–25 (FOUNDATIONS_SPEC §5, §6).