The motion toggle holds the page's ambient motion still: the ink field's loops and the blocks' idle moves. Entrances
and moments a visitor caused still play. It is always in VisitorControls, and a loop-bearing Art corner at
Press and Rave prints one too.
Example#
Usage#
Use the motion toggle wherever something loops: it holds the ambient motion still (the ink field, the blocks' idle moves) while entrances and moments a visitor causes still play. A loop may only run while a toggle is on the page (WCAG 2.2.2, D-E3).
- Where. Always in
VisitorControls, and in the corner of art that loops at Press and Rave (Art loops). - Reduced motion. When the system or the site asks for reduced motion, the toggle shows pressed; pressing it plays again.
copycan name what it pauses: "Pause the art".
Anatomy#
- KeyPause or play glyph, pressed while motion is held.
.mk-motion-toggle
Volume#
The key is identical at every volume. It shows in art corners from Press, where loops are allowed.
Quiet
Studio
Press
Rave
Content#
- "Pause motion" and "Play motion", or name the thing: "Pause the art".
Do and don't#
Do
Don't
A looping ink field with no way to stop it.
Accessibility#
- A real
buttonwitharia-pressed: pressed means motion is held. Its name says what a press does next, "Pause motion" or "Play motion", and its glyph follows. - The choice persists (
localStorage mk-motion) and is set on<html data-mk-motion="pause">before the first paint byPrefsScript. - While at least one toggle is mounted the ink field may loop at Press and Rave; with none it only bursts, so a loop always comes with a visible control (WCAG 2.2.2).
- Enter and Space press it; focus shows the 2 px ring.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
size | Size | none | |
copy | Partial<MotionToggleCopy> | none | |
className | string | none |
Tokens#
System tokens (5)
Changelog#
Arrived in 0.1.0.
./motion: the generated panel and title keyframes, the reveal contract and the reduced-motion block,motionPrepaintScript,MotionRuntime(readiness flags, soft navigations, the keydown finisher), the width axis, andMotionToggle. Read the whole entry