Skip to main content

Usage

Parameters

Return Value

Features

  • Minimum swipe distance threshold (50px) to prevent false positives
  • Detects both left and right swipes
  • Provides touch event handlers for easy integration

Examples

Dismissible Card

Technical Details

  • Minimum swipe distance: 50 pixels
  • Directions detected: "left", "right", or null (if swipe distance is insufficient)
  • The hook tracks touch position using clientX coordinates
  • Regular touch events (taps) are ignored due to the minimum distance threshold
Last modified on December 22, 2025