RE

React Swipeable

react-swipeable

React Swipe event handler hook

Hooks
react swipe
react touch
react hook
touch
swipe
swipeable
react
hook
react-swipeable
Hooks
Stars
2.1k
Weekly
660k
Open issues
30
Bundle
~25 kB

Installation

npm install react-swipeable

Code example

import { useSwipeable } from "react-swipeable";

export function Example() {
  const value = useSwipeable();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by sarmeyer
  • 660k weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~25 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 30 open issues on GitHub

FAQs

Alternatives & similar libraries