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

# MouseDragAction

> Press at (from_x, from_y), move to (to_x, to_y) in `steps` moves, and release: drag, swipe or rotate

> [!TIP]
>
> Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.

canvas, WebGL or 3D objects, sliders and drag-and-drop targets.

**Example:**

```python theme={null}
session.execute(type="mouse_drag", from_x=300, from_y=400, to_x=900, to_y=400)  # swipe right
session.execute(type="mouse_drag", from_x=640, from_y=500, to_x=640, to_y=200, steps=50, hold_ms=200)
```

## Fields

**type** `Literal['mouse_drag']` (default: mouse\_drag)

**category** `str` (default: Special Browser Actions)

**description** `str` (default: Press at viewport coordinates (from\_x, from\_y), move to (to\_x, to\_y) and release: swipe, drag or rotate canvas, WebGL or 3D objects and sliders)

**from\_x** `float` *required*

Horizontal start coordinate in CSS pixels from the top-left corner of the viewport, as in a screenshot at device scale 1

**from\_y** `float` *required*

Vertical start coordinate in CSS pixels from the top-left corner of the viewport, as in a screenshot at device scale 1

**to\_x** `float` *required*

Horizontal end coordinate in CSS pixels from the top-left corner of the viewport, as in a screenshot at device scale 1

**to\_y** `float` *required*

Vertical end coordinate in CSS pixels from the top-left corner of the viewport, as in a screenshot at device scale 1

**steps** `int` (default: 25)

Number of intermediate pointer moves: more steps make a smoother, slower gesture

**button** `Literal['left', 'right', 'middle']` (default: left)

**hold\_ms** `int` (default: 0)

Time to hold the button down before moving, in milliseconds

## Module

`notte_core.actions.actions`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.