Gesture

This component is a generic container for other components. It supports multiple gestures – tapping, double-tapping, long-pressing, panning, and pinching.

Styles

  • Flexbox Styles

  • View Styles

  • Transform Styles

Props

Name

Type

Description

accessibilityLabel

string

  • Alternate text for screen readers

accessibilityTraits

AccessibilityTrait | AccessibilityTrait[]

  • Traits used to hint screen readers, etc.

importantForAccessibility?

ImportantForAccessibility

  • Expose the element and/or its children as accessible to Screen readers

onPinchZoom

(gestureState: MultiTouchGestureState) => void

  • Gestures and attributes that apply only to touch inputs

onRotate

(gestureState: MultiTouchGestureState) => void

  • Gestures and attributes that apply only to touch inputs

onScrollWheel

(gestureState: ScrollWheelGestureState) => void

  • Gestures and attributes that apply only to mouse inputs

mouseOverCursor

GestureMouseCursor

  • Gestures and attributes that apply only to mouse inputs

onPan

(gestureState: PanGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onPanVertical

(gestureState: PanGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onPanHorizontal

(gestureState: PanGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onTap

(gestureState: TapGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onDoubleTap

(gestureState: TapGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onContextMenu

(gestureState: TapGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onLongPress

(gestureState: TapGestureState) => void

  • Gestures and attributes that apply to either touch or mouse inputs

onFocus

(e: FocusEvent) => void

  • Focus Events

onBlur

(e: FocusEvent) => void

  • Focus Events

onKeyPress

(e: KeyboardEvent) => void

  • Keyboard Events

preferredPan

PreferredPanGesture = undefined

  • We can set vertical or horizontal as preferred

panPixelThreshold

number

  • How many pixels (in either horizontal or vertical direction) until pan is recognized?

  • Default is 10

  • Can be any value > 0

releaseOnRequest

boolean

  • Something else wants to become responder. Should this view release the responder?

  • Setting true allows release.

testId

string

  • ID that can be used to identify the instantiated element for testing purposes

Last updated