Doko's new lair
React Native Shake

What is this?

A lightweight React Native library that detects shake gestures on iOS and Android.

react-native-shake detects shake gestures on both iOS and Android. It supports React Native's New Architecture (Turbo Modules) as well as the old/legacy architecture, ships full TypeScript definitions, and has no heavy dependencies.

import RNShake from 'react-native-shake';

const subscription = RNShake.addListener(() => {
  console.log('Device shaken!');
});

subscription.remove();

Works best on real devices - shake detection is limited in simulators/emulators.

Requirements

Minimum
iOS13.0+
AndroidAPI 21+ (Android 5.0)
React Native0.68+

Installation

npm install react-native-shake
# or
yarn add react-native-shake

iOS

cd ios && pod install

Android

No additional configuration required - the library links automatically via autolinking (React Native 0.60+).

On this page