R

RatedWithAI

WCAG guidance

Scan your site

WCAG 2.1

2.5.4 Motion Actuation

Level A success criterion

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, unless the motion is essential or disabling would invalidate the activity.

Why it matters

Users with motor impairments who have devices mounted to wheelchairs cannot shake or tilt their device. Others may have tremors causing unintended motion. A UI alternative ensures everyone can access the functionality.

Common violations

  • Shake-to-undo with no alternative undo button
  • Tilt-to-scroll with no scroll controls
  • Device rotation required to change views
  • Motion gestures as the only way to dismiss content

Code examples

Bad

window.addEventListener('devicemotion', (e) => {
  if (Math.abs(e.acceleration.x) > 15) undoLastAction();
});

Good

window.addEventListener('devicemotion', (e) => {
  if (!motionEnabled) return;
  if (Math.abs(e.acceleration.x) > 15) undoLastAction();
});
// Plus a visible undo button in the UI

How to fix

Provide UI controls (buttons, menus) for every motion-triggered action. Add a setting to disable motion responses. Never rely on device motion as the sole interaction method.

Related criteria

Related resources

Scan your site

Check your WCAG coverage in minutes

Start a free scan