# SwipeGesture >![](../../public_sys-resources/icon-note.gif) **NOTE:** >This attribute is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. ## Required Permissions None ## APIs SwipeGesture\(value?: \{ fingers?: number; direction?: SwipeDirection; speed?: number \}\) - Parameters

Name

Type

Mandatory

Default Value

Description

fingers

number

No

1

Minimum number of fingers to trigger a swipe gesture. The value ranges from 1 to 10.

direction

SwipeDirection

No

SwipeDirection.All

Swipe direction

speed

number

No

100

Minimum speed of the swipe operation (100 vp/s).

- SwipeDirection enums

Name

Description

All

All directions.

Horizontal

Horizontal direction.

Vertical

Vertical direction.

## Events

Name

Description

onAction(callback:(event?: SwipeGestureEvent) => void)

Callback for the swipe gesture recognition event.

- SwipeGestureEvent attributes Inherited from [GestureEvent](ts-gesture-settings.md#table290mcpsimp).

Name

Type

Description

angle

number

Angle of the swipe gesture.

speed

number

Speed of the swipe gesture.

## Example ``` @Entry @Component struct SwipeGestureExample { @State rotateAngle : number = 0 @State speed : number = 1 build() { Column() { Text("SwipGesture speed : " + this.speed) Text("SwipGesture angle : " + this.rotateAngle) } .position({x: 80, y: 200}) .border({width:2}) .width(260).height(260) .rotate({x: 0, y: 0, z: 1, angle: this.rotateAngle}) .gesture( SwipeGesture({fingers: 1, direction:SwipeDirection.Vertical}) .onAction((event: SwipeGestureEvent) => { this.speed = event.speed this.rotateAngle = event.angle }) ) } } ``` ![](figures/gif-0.gif)