react-swipeable

  • Version 6.2.0
  • Published
  • 153 kB
  • No dependencies
  • MIT license

Install

npm i react-swipeable
yarn add react-swipeable
pnpm add react-swipeable

Overview

React Swipe event handler hook

Index

Variables

variable DOWN

const DOWN: string;

    variable LEFT

    const LEFT: string;
      const RIGHT: string;

        variable UP

        const UP: string;

          Functions

          function useSwipeable

          useSwipeable: (options: SwipeableProps) => SwipeableHandlers;

            Interfaces

            interface SwipeableHandlers

            interface SwipeableHandlers {}

              method onMouseDown

              onMouseDown: (event: any) => void;

                method ref

                ref: (element: HTMLElement | null) => void;

                  interface SwipeEventData

                  interface SwipeEventData {}

                    property absX

                    absX: number;

                      property absY

                      absY: number;

                        property deltaX

                        deltaX: number;

                          property deltaY

                          deltaY: number;

                            property dir

                            dir: SwipeDirections;

                              property event

                              event: HandledEvents;

                                property first

                                first: boolean;

                                  property initial

                                  initial: Vector2;

                                    property velocity

                                    velocity: number;

                                      property vxvy

                                      vxvy: Vector2;

                                        Type Aliases

                                        type SwipeableProps

                                        type SwipeableProps = Partial<SwipeableCallbacks & ConfigurationOptions>;

                                          type SwipeCallback

                                          type SwipeCallback = (eventData: SwipeEventData) => void;

                                            type SwipeDirections

                                            type SwipeDirections = typeof LEFT | typeof RIGHT | typeof UP | typeof DOWN;

                                              type TapCallback

                                              type TapCallback = ({ event }: { event: HandledEvents }) => void;

                                                type Vector2

                                                type Vector2 = [number, number];

                                                  Package Files (2)

                                                  Dependencies (0)

                                                  No dependencies.

                                                  Dev Dependencies (28)

                                                  Peer Dependencies (1)

                                                  Badge

                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-swipeable.

                                                  • Markdown
                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-swipeable)
                                                  • HTML
                                                    <a href="https://www.jsdocs.io/package/react-swipeable"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>