react-use-gesture
- Version 9.1.3
- Published
- 1.07 MB
- No dependencies
- MIT license
Install
npm i react-use-gesture
yarn add react-use-gesture
pnpm add react-use-gesture
Overview
React hook for receiving gestures https://use-gesture.netlify.app
Index
Functions
function addV
addV: <T extends number[]>(v1: T, v2: T) => T;
function rubberbandIfOutOfBounds
rubberbandIfOutOfBounds: ( position: number, min: number, max: number, constant?: number) => number;
function subV
subV: <T extends number[]>(v1: T, v2: T) => T;
function useDrag
useDrag: <K = any>( handler: Handler<'drag', K>, config?: UseDragConfig | {}) => (...args: any[]) => import('../types').ReactEventHandlers;
Drag hook.
Parameter handler
the function fired every time the drag gesture updates
Parameter config
the config object including generic options and drag options
function useGesture
useGesture: < T extends Partial< { drag: any; wheel: any; scroll: any; move: any; pinch: any; hover: any } & { [x: string]: any; [x: number]: any; [x: symbol]: any; } > = EventTypes>( _handlers: Handlers<T>, config?: UseGestureConfig) => (...args: any[]) => import('../types').ReactEventHandlers;
The most complete gesture hook, allowing support for multiple gestures.
Parameter handlers
an object with on[Gesture] keys containg gesture handlers
Parameter config
the full config object
Returns
{(...args: any[]) => HookReturnType}
Modifiers
@public
function useHover
useHover: <K = any>( handler: Handler<'hover', K>, config?: UseHoverConfig | {}) => (...args: any[]) => import('../types').ReactEventHandlers;
Hover hook.
Parameter handler
the function fired every time the hover gesture updates
Parameter config
the config object including generic options and hover options
function useMove
useMove: <K = any>( handler: Handler<'move', K>, config?: UseMoveConfig | {}) => (...args: any[]) => import('../types').ReactEventHandlers;
Move hook.
Parameter handler
the function fired every time the move gesture updates
Parameter config
the config object including generic options and move options
function usePinch
usePinch: <K = any>( handler: Handler<'pinch', K>, config?: UsePinchConfig | {}) => (...args: any[]) => import('../types').ReactEventHandlers;
Pinch hook.
Parameter handler
the function fired every time the pinch gesture updates
Parameter config
the config object including generic options and pinch options
function useScroll
useScroll: <K = any>( handler: Handler<'scroll', K>, config?: UseScrollConfig | {}) => (...args: any[]) => import('../types').ReactEventHandlers;
Scroll hook.
Parameter handler
the function fired every time the scroll gesture updates
Parameter config
the config object including generic options and scroll options
function useWheel
useWheel: <K = any>( handler: Handler<'wheel', K>, config?: UseWheelConfig | {}) => (...args: any[]) => import('../types').ReactEventHandlers;
Wheel hook.
Parameter handler
the function fired every time the wheel gesture updates
Parameter the
config object including generic options and wheel options
Package Files (10)
Dependencies (0)
No dependencies.
Dev Dependencies (29)
- @babel/core
- @size-limit/preset-small-lib
- @storybook/addon-actions
- @storybook/addon-essentials
- @storybook/addon-info
- @storybook/addon-links
- @storybook/addons
- @storybook/react
- @testing-library/jest-dom
- @testing-library/react
- @types/jest
- @types/react
- @types/react-dom
- babel-jest
- babel-loader
- eslint-plugin-jest-dom
- eslint-plugin-prettier
- eslint-plugin-testing-library
- husky
- prettier
- pretty-quick
- react
- react-dom
- react-is
- react-spring
- size-limit
- tsdx
- tslib
- typescript
Peer Dependencies (1)
Badge
To add a badge like this oneto 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-use-gesture
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-use-gesture)
- HTML<a href="https://www.jsdocs.io/package/react-use-gesture"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2943 ms. - Missing or incorrect documentation? Open an issue for this package.