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-toast-feedback

v0.1.2

Published

Toast-first React Native feedback library with animated slide/fade notifications, progress toasts (countdown, actions, persistent mode), ShakeInput for validation feedback, and PulseButton micro-interactions for loading and touch response.

Readme

react-native-toast-feedback

Animated feedback library for React Native with a toast-first focus:

  • Toast handling API with imperative show() and hide()
  • Smooth slide/fade toast animation
  • Progress toast features (progress bar, countdown, action button)

No native modules required. Pure Animated API.


Overview

react-native-toast-feedback helps you add polished, high-signal UI feedback to React Native apps without adding heavy setup or native dependencies.

It is built around a practical toast workflow (ref.current?.show(...)) and also includes two supporting micro-interactions:

  • a shakeable input for validation errors
  • a pulse button for press feedback and loading states

The goal is to make app feedback feel responsive and intentional with minimal code.

Why this library

  • Toast-first API: Trigger notifications from async workflows, forms, and network actions using an imperative ref pattern.
  • Lightweight animations: Uses React Native Animated directly, so setup stays simple.
  • Consistent feedback primitives: Toasts, shake inputs, and pulse buttons share a common "instant feedback" design philosophy.
  • TypeScript-ready: Exposes typed refs and props for safer integration.

Common use cases

  • Show success/error/info messages after API requests
  • Display long-running action progress (upload, sync, import) with optional countdown and action button
  • Shake an input when validation fails
  • Disable a submit button with a loading spinner while requests are in flight

How it works

  • Mount one <ToastNotification /> near a screen or app root.
  • Keep a ref to call show() and hide() from handlers.
  • Pick the visual variant (success, error, info, warning) per event.
  • Optionally enable progress mode with showProgress, showCountdown, actionLabel, and persistent.

Compatibility

  • React Native library (no native module linking required)
  • Works with JavaScript and TypeScript projects
  • Suitable for apps that want a small feedback layer without adding larger UI frameworks

Core Focus: Toasts

| Component | Effect | |---|---| | <ToastNotification /> | Slide/fade toast with success, error, info, warning variants | | Progress Toast | Optional progress bar, countdown timer, action button, and persistent mode |

Secondary Effects

| Component | Effect | |---|---| | <ShakeInput /> | Shakes the input horizontally on error | | <PulseButton /> | Press scale + pulse ring animation, optional loading spinner |


Installation

npm install react-native-toast-feedback
# or
yarn add react-native-toast-feedback

No pod install or linking needed.


Quick Usage

Toast Handling + Animation (ToastNotification)

import { ToastNotification } from 'react-native-toast-feedback';

const toastRef = useRef(null);

// Mount once near screen root:
<ToastNotification ref={toastRef} position="top" />

// Trigger toast effect:
toastRef.current?.show({
  message: 'Successfully saved!',
  type: 'success',
  duration: 3000,
});

Progress Toast

toastRef.current?.show({
  message: 'Uploading profile photo...',
  type: 'info',
  duration: 5000,
  showProgress: true,
  showCountdown: true,
  actionLabel: 'Cancel',
  onActionPress: () => console.log('Upload cancelled'),
});

Secondary: Input Shake (ShakeInput)

import { ShakeInput } from 'react-native-toast-feedback';

const ref = useRef(null);

ref.current?.shake();

<ShakeInput ref={ref} placeholder="Password" secureTextEntry />

Secondary: Pulse Button (PulseButton)

import { PulseButton } from 'react-native-toast-feedback';

<PulseButton title="Submit" color="#4f46e5" onPress={() => console.log('Pressed')} />
// Loading state
<PulseButton
  title="Submit"
  loading
  loadingText="Please wait..."
  onPress={handleSubmit}
/>

Props

Toast Container Props (ToastNotification)

| Prop | Type | Default | Description | |---|---|---|---| | position | 'top' \| 'bottom' | 'top' | Screen edge | | offset | number | 50 | px from edge |

show() options (toast + progress toast):

| Key | Type | Default | Description | |---|---|---|---| | message | string | — | Text to display | | type | 'success' \| 'error' \| 'info' \| 'warning' | 'info' | Visual style | | duration | number | 3000 | Auto-hide delay in ms | | showProgress | boolean | false | Shows shrinking progress bar | | showCountdown | boolean | false | Shows remaining seconds | | actionLabel | string | — | Action button text | | onActionPress | function | — | Action callback | | persistent | boolean | false | Stays visible until dismissed |

Secondary Input Props (ShakeInput)

| Prop | Type | Default | Description | |---|---|---|---| | shakeDuration | number | 400 | Total duration of shake in ms | | shakeIntensity | number | 10 | Max horizontal offset in px | | shakeColor | string | '#e74c3c' | Border color during shake | | ...TextInputProps | — | — | All standard TextInput props |

Secondary Button Props (PulseButton)

| Prop | Type | Default | Description | |---|---|---|---| | title | string | 'Press Me' | Button label | | onPress | function | — | Press handler | | status | 'idle' \| 'loading' \| 'success' \| 'error' | 'idle' | Current implemented UI state uses loading/status='loading' for spinner/disable | | loading | boolean | false | Shows spinner and disables press | | loadingText | string | — | Label while loading | | successText | string | — | Reserved prop for custom success label | | errorText | string | — | Reserved prop for custom error label | | color | string | '#4f46e5' | Base background color | | successColor | string | — | Reserved prop for success background | | errorColor | string | — | Reserved prop for error background | | textColor | string | '#fff' | Label color | | loadingIndicatorColor | string | textColor | Spinner color | | pulseColor | string | same as color | Pulse ring color | | disabled | boolean | false | Disable press and animation |


License

MIT