You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@candlefinance/haptics

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@candlefinance/haptics

Haptic feedback generator with support for playing patterns.

latest
Source
npmnpm
Version
0.3.3
Version published
Maintainers
3
Created
Source

npm downloads discord users online

Haptics for React Native


Supports playing haptics on iOS with default UIImpactFeedbackGenerator and CoreHaptics for patterns and ahap files. Vibrates on Android.

Installation

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

Basic Usage

There are three functions:

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

// light, medium, heavy, soft, rigid, warning, error, success, selectionChanged
haptic('medium');

// pattern
hapticWithPattern(['.', '.', '.', 'o', 'O', '-', 'O', 'o', '.', '.', '.', '.']);

// play ahap file (iOS only)
play('fileName');

The pattern format:

- 'o' - medium impact
- 'O' - heavy impact
- '.' - light impact
- ':' - soft impact
- '-' - wait of 0.1 second
- '=' - wait of 1 second

For playing ahap files to the root of your project add a folder called haptics and add your ahap files there. Use (Haptrix)[https://www.haptrix.com/] or equivalent to generate ahap files.

Contributing

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

License

MIT

Keywords

react-native

FAQs

Package last updated on 20 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts