State layer
The content color is mixed over the container at a state-specific opacity. Hover, focus, press, and drag become visible without replacing the component's semantic colors.
A state needs two visual channels when accessibility calls for them: a state layer changes the component, and focus also draws a ring that identifies where keyboard interaction landed.
The content color is mixed over the container at a state-specific opacity. Hover, focus, press, and drag become visible without replacing the component's semantic colors.
Keyboard focus also paints Material's secondary-color ring. Its short pulse points to the landing location; reduced-motion removes the pulse while keeping the resting ring.
| State | Token | Amount |
|---|---|---|
| Hover | --md-sys-state-hover-state-layer-opacity | 8% |
| Focus | --md-sys-state-focus-state-layer-opacity | 10% |
| Pressed | --md-sys-state-pressed-state-layer-opacity | 10% |
| Dragged | --md-sys-state-dragged-state-layer-opacity | 16% |
Do not lower the opacity of the whole component. Material repaints its container with on-surface at 12% and its content at 38%. Two amounts preserve legibility and hierarchy.
Prefer native :hover, :focus-visible, :active, and aria-pressed. Use a headless library's documented data-state only when native semantics cannot express the state.