Skip to main content
Visual Arts & DesignUX Design Patterns29 lines

Accessible Web Touch Gestures

Implement swipe or drag on web interfaces while preserving page scroll, zoom, tap alternatives and keyboard access. Use for mobile and mixed-input interaction review.

Quick Summary9 lines
Start by describing the operation without gestures: move a card, change a slide, or adjust a value. Implement the operation once and expose it through appropriate keyboard and simple single-pointer controls. For a drag reorder, a user can select a card and then choose a destination or press a move button. For a swipe gallery, keep previous and next buttons. A keyboard-only alternative does not satisfy a requirement for a non-drag pointer alternative.

## Key Points

- [W3C Pointer Events](https://www.w3.org/TR/pointerevents3/)
- [W3C dragging movements guidance](https://www.w3.org/WAI/WCAG22/Understanding/dragging-movements)
- [W3C input modalities](https://www.w3.org/WAI/WCAG22/Understanding/input-modalities)
skilldb get ux-design-patterns-skills/touch-gesturesFull skill: 29 lines
Paste into your CLAUDE.md or agent config

Accessible Web Touch Gestures

Start by describing the operation without gestures: move a card, change a slide, or adjust a value. Implement the operation once and expose it through appropriate keyboard and simple single-pointer controls. For a drag reorder, a user can select a card and then choose a destination or press a move button. For a swipe gallery, keep previous and next buttons. A keyboard-only alternative does not satisfy a requirement for a non-drag pointer alternative.

Let the browser handle normal input

Use Pointer Events for interactions that need pointer identity and unified mouse, touch or pen handling. Choose touch-action narrowly, before the gesture starts, based on which axis or interaction the component actually owns. Keep page scrolling and browser zoom available wherever compatible. Do not disable touch behavior across the whole page. Let ambiguous movement remain a page gesture until the component's own activation rule is met.

Use a movement threshold or explicit handle to separate taps from drags. Use pointer capture when the control must track the same pointer outside its bounds, and handle pointercancel, lost capture, extra pointers and component teardown. Preview changes during movement and commit only through an explicit end condition. Cancel restores the previous state. Prevent the following click only for a completed gesture whose click would cause an unintended duplicate action.

Verify mixed input and recovery

On a real touch target, test slow vertical scrolling across the component, a diagonal gesture, tapping a visible control, pinch zoom and interruption by browser behavior. Verify a mouse release outside the target, keyboard operation and use of the non-drag pointer alternative. Use the same data fixture to compare results across inputs. Check large text and reduced-motion preferences without removing control feedback.

Record browser, OS, device and input types. If the only test was browser emulation, identify the physical behavior it could not establish, including OS gesture competition and tactile timing.

References and rights

Original SkillDB instructions under LicenseRef-SkillDB-Content. References were checked 2026-11-13 and used for technical verification.

Install this skill directly: skilldb add ux-design-patterns-skills

Get CLI access →