For AI agents: the complete documentation index is available at /2.x/llms.txt, the full documentation bundle is available at /2.x/llms-full.txt, and this page is available as Markdown at /2.x/guide/usage/gesture-features.md.
v3 is stable. See what changed
  • English
  • 2.x
  • Gesture Features

    react-native-gesture-image-viewer supports various gestures essential for viewers. Please refer to the examples below for default gesture actions.

    import { GestureViewer } from 'react-native-gesture-image-viewer';
    
    function App() {
      return (
        <GestureViewer
          data={images}
          renderItem={renderImage}
          dismiss={{
            enabled: true,
            direction: 'down',
            threshold: 80,
            resistance: 2,
            fadeBackdrop: true,
          }}
          enableHorizontalSwipe={true}
          enablePinchZoom={true}
          enableDoubleTapZoom={true}
          enablePanWhenZoomed={true}
        />
      );
    }

    Gesture Props

    dismiss

    Dismiss gesture options. Controls which vertical swipe direction can trigger onDismiss, making it useful for modal-style close gestures with backward-compatible downward dismiss by default.

    PropertyDescriptionTypeDefault
    enabledWhen false, dismiss gesture is disabled.booleantrue
    directionControls which vertical swipe direction can dismiss.down, up, bothdown
    thresholdthreshold controls when onDismiss is called by applying a threshold value during vertical gestures.number80
    resistanceresistance controls the range of vertical movement by applying resistance during dismiss gestures.number2
    fadeBackdropBy default, the background opacity gradually decreases as you drag in the configured dismiss direction.booleantrue

    enableHorizontalSwipe (default: true)

    Controls left/right swipe gestures. When false, horizontal gestures are disabled.

    enablePinchZoom (default: true)

    Controls two-finger pinch gestures with focal point zooming. When false, pinch zoom is disabled. Zoom centers on the point between your two fingers for intuitive scaling.

    enableDoubleTapZoom (default: true)

    Controls double-tap zoom gestures with precision targeting. When false, double-tap zoom is disabled. Zoom centers exactly on the tapped location.

    enablePanWhenZoomed (default: true)

    Enables panning when zoomed in with automatic boundary detection. When false, movement is disabled during zoom. Prevents content from moving outside visible screen area.