New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@1ohooks/swipeable

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@1ohooks/swipeable

[![Version](https://img.shields.io/npm/v/@1ohooks/swipeable.svg)](https://www.npmjs.org/package/@1ohooks/swipeable) [![Coverage Status](https://coveralls.io/repos/github/1ohooks/swipeable/badge.svg?branch=master)](https://coveralls.io/github/1ohooks/swipe

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@1ohooks/swipeable

Version Coverage Status Downloads Try on RunKit

The @1ohooks/swipeable package provides hooks for handling swipe gestures in React applications.

Installation

Install the package with:

npm install @1ohooks/swipeable
# or
yarn add @1ohooks/swipeable

Documentation

useHorizontalSwipeMinimum

The useHorizontalSwipeMinimum hook allows you to detect horizontal swipe gestures.

import { useHorizontalSwipeMinimum } from '@1ohooks/swipeable';

// Usage example
function MyComponent() {
  useHorizontalSwipeMinimum(50, () => {
    // Handle swipe left
  }, () => {
    // Handle swipe right
  });

  return (
    // Your component JSX
  );
}

useVerticalSwipeMinimum

The useVerticalSwipeMinimum hook allows you to detect vertical swipe gestures.

import { useVerticalSwipeMinimum } from '@1ohooks/swipeable';

// Usage example
function MyComponent() {
  useVerticalSwipeMinimum(50, () => {
    // Handle swipe up
  }, () => {
    // Handle swipe down
  });

  return (
    // Your component JSX
  );
}

useSwipe

The useSwipe hook provides a more versatile way to handle swipe gestures with customizable options.

import { useSwipe } from '@1ohooks/swipeable';

// Usage example
function MyComponent() {
  const { swipeDistance } = useSwipe({
    threshold: 50,
    onSwipeLeft: () => {
      // Handle swipe left
    },
    onSwipeRight: () => {
      // Handle swipe right
    },
    // Additional configuration options
  });

  return (
    // Your component JSX
  );
}

Requirements

  • React 16 or higher.

Usage

You can easily integrate the swipe gestures into your React components by importing and using the provided hooks.

For more advanced usage and configuration options, refer to the individual hook documentation.

FAQs

Package last updated on 24 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc