WCAG 2.5.4: Motion Actuation
“Shake to undo” assumes you can shake a phone — and that you never shake it by accident. Both assumptions fail for many people. This criterion requires that anything operated by device or user motion also works through ordinary UI controls, and that motion response can be switched off. Motion is a fine shortcut; it can never be the only way, and it must never be inescapable.
The success criterion, in full
Functionality that can be operated by device motion or user motion can also be operated by user interface components and responding to the motion can be disabled to prevent accidental actuation, except when:
- Supported Interface: The motion is used to operate functionality through an accessibility supported interface;
- Essential: The motion is essential for the function and doing so would invalidate the activity.
Note the two-part obligation outside the exceptions: a conventional UI alternative and the ability to disable motion response. Meeting only one of the two is still a failure.
Who this helps
Motion controls create two mirror-image barriers: people who cannot produce the required motion, and people who cannot avoid producing it.
People whose devices are mounted
A phone or tablet fixed to a wheelchair, bed frame, or desk mount physically cannot be shaken or tilted. Any motion-only feature is simply unavailable to them.
People with limited strength or range of motion
Muscular dystrophy, arthritis, paralysis, or fatigue can make a deliberate shake or a controlled tilt impossible, even when the device is hand-held.
People with tremors or spasms
The opposite problem: involuntary movement constantly triggers motion features. 'Shake to undo' firing during typing can repeatedly destroy someone's work — which is why disabling motion response is a hard requirement.
Everyone in motion-hostile situations
A bumpy bus ride triggers shake gestures; a device lying flat on a table cannot be tilted. Conventional controls keep the feature usable everywhere.
The design pattern that satisfies everyone is the same one that works for 2.5.1 Pointer Gestures: build the feature on ordinary buttons first, then layer motion on top as an optional, user-controllable enhancement.
What counts as motion actuation
The criterion covers functionality your content operates in response to:
- Device motion — shaking, tilting, or rotating the device, read from the accelerometer or gyroscope. On the web this arrives through the
devicemotionanddeviceorientationevents and the Generic Sensor API. - User motion sensed by the device — gestures detected by a camera or other sensor, such as waving a hand to advance slides or nodding to confirm.
Out of scope: pointer movement across the screen (covered by 2.5.1 and 2.5.7), keyboard and switch input, and motion your content merely reacts to visually without operating functionality — although gratuitous motion-driven animation raises its own issues under 2.3.3 Animation from Interactions (Level AAA).
The two exceptions are narrow. Supported Interface covers motion used as an assistive input method — a user whose AT converts head movement into clicks. That is their input device, not your feature. Essential covers functions that are motion by definition — a pedometer counting steps — where a button alternative would falsify the activity itself.
Pass and fail examples
Pass: shake-to-undo with an Undo button and a setting
A note-taking web app supports shaking to undo, shows an Undo button in the toolbar, and offers a “Use motion controls” toggle in settings. Alternative present, motion disableable — both conditions met.
Pass (essential): step counter
A fitness web app counts steps from accelerometer data. Motion is the very thing being measured — a button that adds fake steps would invalidate the activity. The Essential exception applies.
Fail: shake as the only way to shuffle
A playlist app shuffles songs when the phone is shaken and provides no shuffle button. Users with mounted devices or limited mobility cannot shuffle at all.
Fail: tilt-to-scroll that cannot be turned off
A reading app scrolls the page as the device tilts. Scroll buttons exist, but there is no way to disable the tilt response — so a user with a tremor watches the page lurch with every involuntary movement. The alternative alone is not enough.
Fail: wave-at-camera slide control with no buttons
A presentation viewer advances slides when the camera detects a hand wave, with no next/previous buttons and no way to switch the camera gesture off. Both requirements missed.
Code examples
Shake-to-undo done right
The motion listener drives the same function as a visible button, and a user preference gates the listener entirely.
<!-- ✓ The function is always available as a plain control -->
<button type="button" id="undo">Undo</button>
<label>
<input type="checkbox" id="motion-toggle" />
Enable shake to undo
</label>
<script>
document.getElementById("undo").addEventListener("click", undoLastAction);
const motionToggle = document.getElementById("motion-toggle");
function onShake(event) {
// ✓ Motion response is gated behind the user's opt-in setting
if (!motionToggle.checked) return;
const a = event.accelerationIncludingGravity;
if (Math.abs(a.x) > 25 || Math.abs(a.y) > 25) undoLastAction();
}
window.addEventListener("devicemotion", onShake);
</script>A motion-controls preference in React
Attach the sensor listener only while the preference is on. Removing the listener is the cleanest form of “disabled” — accidental motion can no longer actuate anything.
function useShake(onShake, enabled) {
useEffect(() => {
if (!enabled) return // ✓ motion fully off when disabled
function handle(e) {
const a = e.accelerationIncludingGravity
if (a && (Math.abs(a.x) > 25 || Math.abs(a.y) > 25)) onShake()
}
window.addEventListener("devicemotion", handle)
return () => window.removeEventListener("devicemotion", handle)
}, [enabled, onShake])
}
function Editor() {
const [motionEnabled, setMotionEnabled] = useState(false) // opt-in
useShake(undoLastAction, motionEnabled)
return (
<>
<button type="button" onClick={undoLastAction}>Undo</button>
<label>
<input
type="checkbox"
checked={motionEnabled}
onChange={(e) => setMotionEnabled(e.target.checked)}
/>
Enable shake to undo
</label>
</>
)
}Tilt-driven 360° viewer with button fallback
<!-- ✓ Rotation works by buttons; tilt is an optional extra -->
<div role="group" aria-label="Rotate product view">
<button type="button" onclick="rotateView(-15)">Rotate left</button>
<button type="button" onclick="rotateView(15)">Rotate right</button>
<button type="button" id="tilt-toggle" aria-pressed="false"
onclick="toggleTilt(this)">
Tilt to rotate: off
</button>
</div>
<script>
function toggleTilt(btn) {
const on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", String(on));
btn.textContent = on ? "Tilt to rotate: on" : "Tilt to rotate: off";
if (on) {
window.addEventListener("deviceorientation", tiltHandler);
} else {
window.removeEventListener("deviceorientation", tiltHandler);
}
}
</script>Common failures
- Shake, tilt, or rotate as the only way to trigger a function — undo, shuffle, refresh, easter eggs that reveal real functionality.
- Providing a button alternative but no way to disable the motion response, leaving tremor-prone users exposed to constant accidental triggers.
- Providing a disable toggle but no UI alternative — turning motion off then removes the feature entirely for that user.
- Camera-gesture controls (wave to advance, nod to confirm) with no on-screen equivalent controls.
- Tilt-based panning of maps, panoramas, or 360° images with no drag or button-based panning.
- Burying the motion toggle where users who need it cannot find it, or resetting it on every visit.
- Claiming the essential exception for features where motion is a stylistic choice (tilt steering in a game, shake to submit feedback) rather than the thing being measured.
How to test for 2.5.4
- 1
Find every motion listener in the code
Search for devicemotion, deviceorientation, deviceorientationabsolute, the Generic Sensor API (Accelerometer, Gyroscope), and camera/gesture-recognition libraries. Each hit marks functionality that responds to motion.
- 2
Trigger each motion feature on a real device
Shake, tilt, and wave as the feature intends, and note exactly what each motion does. Browser DevTools sensor emulation (Chrome DevTools > Sensors) can simulate orientation if hardware is inconvenient.
- 3
Achieve every motion outcome without moving the device
For each function found, perform it using only on-screen controls: an Undo button, rotate buttons, next-slide buttons. If any outcome is reachable only by motion, it fails (unless a documented exception applies).
- 4
Disable motion and confirm silence
Find the setting that turns motion response off (yours or a respected system setting). Enable it, then shake and tilt vigorously: nothing should actuate. If no such setting exists, the criterion fails even with perfect button alternatives.
- 5
Review claimed exceptions
For anything left, verify the motion is genuinely essential (the motion is what is being measured) or arrives via the user's own accessibility-supported input method. Convenience, delight, and branding do not qualify.
Motion features are rare enough that this test is quick — but invisible to automated scanners, so it must be on your manual pass. The full WCAG 2.2 checklist keeps it alongside the other input-modality checks.
Frequently asked questions
What does WCAG 2.5.4 Motion Actuation require?
Any functionality that can be operated by moving the device (shake, tilt, rotate — via accelerometer or gyroscope) or by user movement detected by sensors such as a camera (waving a hand) must meet two requirements: it must also be operable through conventional user interface components like buttons, and the motion response must be able to be disabled to prevent accidental actuation. Two exceptions exist: when motion is used through an accessibility-supported interface, and when motion is essential to the function. It is a Level A criterion introduced in WCAG 2.1.
Why must motion response be disableable, not just have an alternative?
Because the harm runs both ways. Some users cannot produce the motion — a phone mounted to a wheelchair cannot be shaken. Other users produce motion they do not intend: someone with a tremor or spasticity may trigger 'shake to undo' constantly, losing work each time. A button alternative solves the first problem but not the second; only the ability to turn motion detection off protects people from accidental actuation. That is why the criterion requires both.
What kinds of motion does 2.5.4 cover?
Two categories: device motion — shaking, tilting, or rotating the device, as sensed by accelerometer and gyroscope and exposed to web content through APIs like devicemotion and deviceorientation — and user motion detected by sensors, such as waving at a camera to advance a slide. It does not cover movement of the pointer (gestures are 2.5.1, dragging is 2.5.7), keyboard input, or motion the operating system itself interprets as part of an accessibility feature.
What is the 'supported interface' exception?
Motion may be used to operate functionality when it happens through an accessibility-supported interface — for example, a user who cannot press keys may deliberately configure an assistive technology that converts their head movements into simulated keystrokes or clicks. In that case the motion is the user's chosen input method, handled by their AT, and the web content is simply receiving standard input events. The exception does not cover your own custom motion features; those still need alternatives and a disable option.
When is motion 'essential' under 2.5.4?
When the function cannot exist without it. The standard example is a pedometer or step-counting app: counting steps is measuring motion, so requiring motion is intrinsic and providing a button that 'fakes' steps would invalidate the activity. Similarly, an app that measures leveling by tilt needs the tilt data. Games that merely use tilt for steering usually do not qualify — steering can be done with buttons — so they need alternatives.
Does the operating system's own motion setting satisfy the 'can be disabled' requirement?
It can help. If users can turn off motion actuation at the system or user-agent level and your content respects that, the goal of preventing accidental actuation is met. In practice, web content cannot always rely on such a setting existing on every platform, so the robust approach is to provide your own toggle — a simple 'Use motion controls' setting — and to treat motion as an opt-in enhancement layered on top of fully functional buttons.
Related Success Criteria
Functionality that uses multipoint or path-based gestures has alternatives.
Functions triggered by single pointer can be cancelled or undone.
The accessible name contains the visible label text.
Target size is at least 44 by 44 CSS pixels except in specific cases.
Content does not restrict use of input modalities.