Skip to main content

Module state

Module state 

Source
Expand description

M3 state layers and disabled emphasis, resolved over the container so a selected control keeps its color under hover and press.

Reference priority is Figma kit > md3.io > m3e.kyralabs.dev. The Figma Material 3 Design Kit defines the layer opacities as its M3 variables State Layers/<role>/Opacity-08|10|16 (file key ozddDB2Z1v51f1IFZlUuJ2), used by its Buttons page as hover 08, focus 10 and a pressed ripple at 10; disabled content is on-surface under a 0.38 layer and disabled button containers are State Layers/On Surface/Opacity-10. Fixture: tests/fixtures/figma-sys-tokens.json. md3.io and m3e (tests/fixtures/m3e-sys-tokens.json) agree. DISABLED_CONTAINER is the classic 12% default for components whose kit page does not override it (buttons use 10%).

Constants§

DISABLED_CONTAINER
Disabled containers and content: on-surface at 12% and 38%.
DISABLED_CONTENT
DRAG
FOCUS
HOVER
PRESS
TEXT_SELECTION
The text selection highlight: primary at 40% (Compose Material 3 TextSelectionColors.kt, TextSelectionBackgroundOpacity = 0.4f).

Functions§

disabled
color at disabled content emphasis. The emphasis multiplies the color’s own alpha, so an already translucent role stays proportionally fainter.
hovered
container under a hover layer of its content color.
layer
Composite a state layer of content at opacity over container (source-over alpha compositing).
pressed
container under a press layer of its content color.