Skip to content

Latest commit

 

History

History

example



Haptics for React Native


Currently the project only supports the iOS using Haptica under the hood.

Installation

yarn add @candlefinance/haptics
npm i @candlefinance/haptics

Basic Usage

There are two functions:

import { haptic, hapticWithPattern } from '@candlefinance/haptics';

haptic('medium'); // light, medium, heavy, etc.
hapticWithPattern(
  ['.', '.', '.', 'o', 'O', '-', 'O', 'o', '.', '.', '.', '.'],
  0.1
);

The pattern format:

  • O - heavy impact
  • o - medium impact
  • . - light impact
  • X - rigid impact
  • x - soft impact
    • wait 0.1 second

Contributing

Join our Discord and ask questions in the #oss channel.

License

MIT