# Gestural Alternatives and Motion Activation

> Canonical HTML version: https://rocketvalidator.com/glossary/gestural-alternatives-motion-activation
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Gestural alternatives and motion activation refer to the WCAG requirements that any functionality triggered by device motion or multipoint/path-based gestures must also be operable through single-pointer actions and conventional controls, so that people with motor impairments can access all features without performing complex physical movements.

WCAG 2.1 introduced two success criteria that address physical interaction patterns: SC 2.5.1 Pointer Gestures (Level A) and SC 2.5.4 Motion Actuation (Level A). Together, they ensure that web content does not depend exclusively on complex gestures or device movement to operate. SC 2.5.1 requires that any function using multipoint gestures (like pinch-to-zoom) or path-based gestures (like swiping) can also be performed with a single pointer without a path-based movement, such as a simple tap or click. SC 2.5.4 requires that any function triggered by device motion (like shaking a phone to undo) can also be triggered through a standard user interface component, and that motion actuation can be disabled to prevent accidental triggering.

These criteria exist because many users cannot perform gestures that require multiple fingers, steady hand movement along a specific path, or physical motion of a device. People who use head pointers, eye-tracking systems, mouth sticks, or switch devices interact through single-point actions. People with tremors or limited hand dexterity may not be able to pinch or swipe reliably. Users with devices mounted to wheelchairs cannot shake or tilt the device. Without alternatives, these users are locked out of functionality entirely.

## Why gestural alternatives and motion activation matter

The population affected by gesture-dependent interfaces is large and varied. It includes people with paralysis, arthritis, repetitive strain injuries, limb differences, and neurological conditions affecting motor control. It also includes situational cases: someone holding a coffee in one hand, or a user whose device is propped on a stand.

When a map widget only supports pinch-to-zoom and drag-to-pan, a switch user cannot navigate it. When a "shake to refresh" feature has no button equivalent, a wheelchair user with a mounted tablet cannot trigger it. When a drawing app requires a swipe path to select a tool, a mouth-stick user cannot reliably trace that path.

Failing these criteria means failing WCAG 2.1 Level A, the baseline conformance level. Since many accessibility laws reference WCAG 2.1 (including the European Accessibility Act and updates to Section 508 guidance), these are not optional niceties.

## How gestural alternatives and motion activation work

### Pointer gestures (SC 2.5.1)

The rule is straightforward: for every multipoint or path-based gesture, provide a single-pointer alternative that does not depend on path. A "single pointer" means one finger, one mouse cursor, or one stylus tip. "Without a path" means the action completes with a simple down-and-up at one location, like a click or tap, or at most a down-at-one-point and up-at-another without requiring a specific trajectory between them.

Common examples:

- A carousel that advances by swiping left should also have "previous" and "next" buttons.
- A map that uses pinch-to-zoom should also have "zoom in" and "zoom out" buttons.
- A list that uses a long swipe to delete should also have a delete button or a context menu accessible via tap.

The gesture itself does not need to be removed. It only needs a companion control.

### Motion actuation (SC 2.5.4)

Any function triggered by device motion (accelerometer, gyroscope) or user motion (detected via camera) must meet two conditions:

1. A user interface mechanism (a button, toggle, or similar control) can trigger the same function.
2. Users can disable the motion response so that accidental movement does not trigger the function.

There is an exception: when the motion is essential to the function and providing an alternative would invalidate the activity. A pedometer app that counts steps by detecting motion is an example of an essential use. A "shake to undo" feature is not essential because undo can be triggered by a button.

## Code examples

### Bad example: swipe-only carousel

This carousel has no alternative to swiping. A user who cannot perform a swipe gesture has no way to advance the slides.

```html
<div class="carousel" id="carousel"
  data-swipe-left="nextSlide()"
  data-swipe-right="prevSlide()">
  <div class="slide active">Slide 1 content</div>
  <div class="slide">Slide 2 content</div>
  <div class="slide">Slide 3 content</div>
</div>
```

### Good example: carousel with button alternatives

The same carousel now has tappable/clickable buttons. The swipe gesture still works for users who prefer it, but every user can also operate the carousel through single-pointer clicks.

```html
<div class="carousel" id="carousel" aria-roledescription="carousel" aria-label="Featured content">
  <div class="slide active" role="group" aria-roledescription="slide" aria-label="1 of 3">
    Slide 1 content
  </div>
  <div class="slide" role="group" aria-roledescription="slide" aria-label="2 of 3">
    Slide 2 content
  </div>
  <div class="slide" role="group" aria-roledescription="slide" aria-label="3 of 3">
    Slide 3 content
  </div>
  <button type="button" aria-label="Previous slide" onclick="prevSlide()">Previous</button>
  <button type="button" aria-label="Next slide" onclick="nextSlide()">Next</button>
</div>
```

### Bad example: shake-to-undo with no alternative and no opt-out

```html
<script>
  window.addEventListener("devicemotion", function(event) {
    if (event.acceleration.x > 15) {
      undoLastAction();
    }
  });
</script>
```

There is no button to trigger undo, and the user cannot disable motion detection. Accidental device movement will fire the undo function.

### Good example: motion actuation with button alternative and opt-out

```html
<div class="toolbar">
  <button type="button" onclick="undoLastAction()" aria-label="Undo">Undo</button>
  <label>
    <input type="checkbox" id="motion-toggle" checked onchange="toggleMotionUndo(this.checked)">
    Enable shake to undo
  </label>
</div>

<script>
  let motionEnabled = true;

  function toggleMotionUndo(enabled) {
    motionEnabled = enabled;
  }

  window.addEventListener("devicemotion", function(event) {
    if (motionEnabled && event.acceleration.x > 15) {
      undoLastAction();
    }
  });

  function undoLastAction() {
    // undo logic here
  }
</script>
```

Now the undo function is available through a button, and users can disable motion detection with a checkbox. Both conditions of SC 2.5.4 are satisfied.

### Testing tips

To verify compliance with SC 2.5.1, identify every gesture-driven interaction on a page and confirm each one has a single-pointer alternative. For SC 2.5.4, check whether the page uses the `devicemotion` or `deviceorientation` APIs, or camera-based motion detection, and confirm that an equivalent UI control exists and that motion response can be turned off. Automated scanners can flag the use of these APIs, but manual testing is needed to confirm that the alternatives work correctly and are discoverable.
