> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# swipe

> Swipe in a direction, optionally within a scroll container.

Swipes the screen or a container in a direction. The simplified form takes a
direction string.

## Parameters

| Parameter         | Type                          | Required | Description                                                                      |
| ----------------- | ----------------------------- | -------- | -------------------------------------------------------------------------------- |
| `direction`       | `up \| down \| left \| right` | Yes      | Swipe direction.                                                                 |
| `in`              | `string \| { x, y, delta }`   | No       | Scroll container: `screen`, `app`, `webview`, a description, or raw coordinates. |
| `viewportPercent` | `number \| string`            | No       | Distance to swipe as a percent of the viewport (e.g. `90` or `"90%"`).           |
| `duration`        | `number`                      | No       | Swipe duration in milliseconds.                                                  |
| `offset`          | `string \| { x, y }`          | No       | Pixel offset for the gesture start (`"x, y"` or `{ x, y }`).                     |
| `saveAs`          | `string`                      | No       | Variable to store this step's return value on `env.<name>`.                      |
| `retries`         | `number`                      | No       | Times to retry the step on failure before failing the test.                      |
| `skipped`         | `boolean`                     | No       | Skip this step at execution time.                                                |

## Shorthand

Direction as a single string.

```yaml theme={null}
- swipe: up
```

## Examples

```yaml theme={null}
- swipe:
    direction: down
    in: the product list # swipe inside this container, not the whole screen
    viewportPercent: 75 # travel 75% of the viewport per swipe
```

## Related

* [Test format](/core-concepts/test-format)
* [scrollTo](/reference/mobile-commands/scroll-to)
