swipe
The swipe action moves a virtual finger (or pointer) across a browser or app surface. Use it when your documentation walks the reader through a gesture that find can’t infer. That covers carousels, onboarding pagers, pull-to-refresh, sliders, and plain “scroll down to see more.”
swipe is the movement subset of dragAndDrop. dragAndDrop locates two elements and moves between them, while swipe moves between two points. You author those points directly, or Doc Detective computes them from a direction shorthand.
The direction is the finger’s motion. Swiping up moves content up, revealing content further down the page. That’s the gesture you make to read more. Swiping left reveals content to the right, such as the next carousel card.
Forms
String shorthand. Swipe up on the active browser tab:
Directional. Swipe 80% of the app window’s height:
Point-to-point. Drag from one point to another:
Point coordinates are pixels from the surface’s top-left corner. That origin is the app window for app surfaces and the viewport for browsers, matching the pixel convention of browser window and viewport sizing. The directional form’s distance stays a fraction of the surface, so directional swipes are portable across window sizes without knowing pixels.
Properties
See the swipe schema reference for the full shapes.
Surface behavior
- Mobile app surfaces (Android/iOS): a real touch gesture through the device driver. Directional swipes stay inside a 10%-inset box so a full-length swipe can’t trigger a system edge gesture (Android back/home).
- Desktop app surfaces (Windows/macOS): a directional swipe scrolls the window with a mouse wheel at the window center. Dragging a desktop window’s content doesn’t scroll it. A point-to-point swipe is a real click-and-drag.
- Browser surfaces: a directional swipe scrolls the page with
window.scrollByunder finger-motion semantics. A mouse drag on a web page selects text instead of scrolling. A point-to-point swipe is a real pointer drag, which suits sliders, canvases, and maps. Point-to-point needs the W3C actions endpoint, so like non-left-button clicks it’s desktop-browser-only for now. - Process surfaces: not applicable. A background process has no screen to swipe, and the schema doesn’t accept one.
A browser directional swipe scrolls. It doesn’t synthesize touch events. A web carousel driven by touch listeners won’t respond. Test it on a mobile app surface, or drive it with a point-to-point swipe if it also handles pointer drags.
You usually don’t need to swipe merely to bring an element into view before a find. find auto-scrolls on mobile app surfaces, and scrolls into view on browsers. Reach for swipe when the gesture itself is what the documentation describes.