npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-whatsapp-audio-recorder

v1.0.0

Published

WhatsApp-style audio recorder for React Native: slide to cancel, slide up to lock

Readme

react-native-whatsapp-audio-recorder

WhatsApp-style audio recorder for React Native with slide to cancel and slide up to lock gestures.

npm version GitHub

Demo

Features

  • Hold to record (reliable touch handling)
  • Slide left/right (RTL-aware) to cancel
  • Slide up to lock recording (hands-free mode)
  • Locked mode: Delete, Stop, or Send
  • Animated waveform
  • Fully customizable overlay

Installation

npm install react-native-whatsapp-audio-recorder

Peer Dependencies

Install these in your project:

npm install react-native-gesture-handler react-native-reanimated react-native-nitro-sound react-native-blob-util react-native-vector-icons

Setup

  1. Wrap your app with GestureHandlerRootView (from react-native-gesture-handler)
  2. Ensure Reanimated is configured in babel.config.js
  3. Android: Add to android/app/build.gradle (before other plugins):
    apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
  4. iOS: Run pod install in the ios folder. Vector icons are bundled via CocoaPods. If icons don't show, add UIAppFonts to Info.plist with the font names (e.g. MaterialIcons.ttf).

Usage

import {
  useWhatsAppAudioRecorder,
  AudioRecorderOverlay,
  formatDuration,
} from "react-native-whatsapp-audio-recorder";
import { GestureDetector } from "react-native-gesture-handler";

function ChatInput() {
  const recorder = useWhatsAppAudioRecorder({
    recordingPath: "voice_message",
    onStopAndSend: async ({ filePath, durationMs, mimeType, fileName }) => {
      await sendVoiceMessage({ filePath, durationMs, mimeType, fileName });
    },
    onBeforeStart: async () => {
      const granted = await requestMicrophonePermission();
      return granted;
    },
  });

  const {
    recordingState,
    recordingDuration,
    isRecording,
    composedGesture,
    waveformAnims,
    panTranslationX,
    panTranslationY,
    micScale,
    slideCancelThreshold,
    slideLockThreshold,
    handleLockedStop,
    handleLockedSend,
    handleLockedCancel,
  } = recorder;

  return (
    <GestureDetector gesture={composedGesture}>
      <View>
        {isRecording || recordingState === "locked" ? (
          <AudioRecorderOverlay
            recordingState={recordingState}
            recordingDuration={recordingDuration}
            waveformAnims={waveformAnims}
            panTranslationX={panTranslationX}
            panTranslationY={panTranslationY}
            slideCancelThreshold={slideCancelThreshold}
            slideLockThreshold={slideLockThreshold}
            isRTL={I18nManager.isRTL}
            formatDuration={formatDuration}
            onLockedCancel={handleLockedCancel}
            onLockedStop={handleLockedStop}
            onLockedSend={handleLockedSend}
            variant="chat"
          />
        ) : (
          <Pressable>
            <MicIcon />
          </Pressable>
        )}
      </View>
    </GestureDetector>
  );
}

API

useWhatsAppAudioRecorder(config)

| Config | Type | Description | |--------|------|-------------| | recordingPath | string | Base filename (without extension) | | onStopAndSend | (params) => Promise | Called when user sends. Params include source: "release" | "send" | "stop" | | onCancel | () => void | Called when user cancels | | onBeforeStart | () => Promise | Return false to abort | | onVoiceRecordingChange | (boolean) => void | Optional state callback | | onRecordingStarted | () => void | Optional. Called when recording starts | | onRecordingLocked | () => void | Optional. Called when user slides up to lock |

AudioRecorderOverlay

| Prop | Type | Description | |------|------|-------------| | variant | "chat" | "standalone" | Layout style | | colors | object | Theme overrides | | formatDuration | (ms) => string | Duration formatter |

Development

# Run example app
npm run example          # Start Metro
npm run example:android  # Run on Android
npm run example:ios      # Run on iOS

Publishing

GitHub

git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/NadeemIqbal/react-native-whatsapp-audio-recorder.git
git push -u origin main

npm

# Login to npm (one-time)
npm login

# Bump version if needed
npm version patch   # 1.0.0 -> 1.0.1
# or
npm version minor   # 1.0.0 -> 1.1.0

# Publish to npm
npm publish

License

MIT