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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-animated-toast-alerts

v0.0.4

Published

An animated toast component for React Native

Downloads

1,316

Readme

React Native Animated Toast

TypeScript Java PRs Welcome License

A modern, highly customizable animated toast notification library for React Native featuring Sonner-style stacking animations, gesture support, and comprehensive TypeScript compatibility.

✨ Features

  • 🎨 Modern Design - Clean, minimalist interface with smooth animations
  • 🔄 Sonner-Style Stacking - Beautiful entrance and exit animations with proper stacking
  • 🌓 Theme Integration - Seamless dark mode support with customizable themes
  • 📱 Multiple Positions - Support for top, bottom, and center positions
  • 👆 Advanced Gestures - Intuitive swipe-to-dismiss with natural physics
  • 💅 Flexible Styling - Extensive customization options for colors, icons, and animations
  • 🔧 TypeScript Support - Comprehensive type definitions for better development
  • Performance Optimized - Efficient animations using React Native's Animated API
  • 🎁 Icon Integration - Seamless support for Lucide icons

🚀 Installation

1. Install the package and dependencies

# Using npm
npm install react-native-animated-toast-alerts lucide-react-native react-native-svg

# Using yarn
yarn add react-native-animated-toast-alerts lucide-react-native react-native-svg

# Using pnpm
pnpm add react-native-animated-toast-alerts lucide-react-native react-native-svg

2. iOS Setup

cd ios && pod install && cd ..

🎯 Quick Start

Set up the Provider

Wrap your application with the ToastProvider:

import { ToastProvider } from 'react-native-animated-toast-alerts';

const App = () => {
  return (
    <ToastProvider>
      <YourApp />
    </ToastProvider>
  );
};

export default App;

Using the Toast

import { useToast } from 'react-native-animated-toast-alerts';
import { Camera } from 'lucide-react-native';

const MyComponent = () => {
  const { showToast } = useToast();

  const handlePress = () => {
    showToast({
      type: 'success',
      message: '✨ Operation completed!',
      position: 'top',
      icon: {
        icon: Camera,
        props: {
          size: 24,
          color: '#16A34A'
        }
      }
    });
  };

  return <Button title="Show Toast" onPress={handlePress} />;
};

🎨 Toast Types

// ℹ️ Info toast
showToast({
  type: 'info',
  message: 'Updates available',
});

// ✅ Success toast
showToast({
  type: 'success',
  message: 'Changes saved!',
});

// ❌ Error toast
showToast({
  type: 'error',
  message: 'Something went wrong',
});

// ⚠️ Warning toast
showToast({
  type: 'warning',
  message: 'Please review input',
});

💅 Customization

Styling Options

showToast({
  type: 'info',
  message: 'Custom styled toast',
  position: 'center',
  customStyle: {
    borderRadius: 12,
    backgroundColor: '#F8FAFC',
  },
  messageStyle: {
    fontSize: 16,
    fontWeight: 'bold',
  },
});

Custom Icons

import { AlertCircle } from 'lucide-react-native';

showToast({
  type: 'info',
  message: 'Custom icon toast',
  icon: {
    icon: AlertCircle,
    props: {
      size: 24,
      color: '#1D4ED8',
      strokeWidth: 2
    }
  }
});

📚 API Reference

ToastOptions

interface ToastOptions {
  type?: 'info' | 'success' | 'error' | 'warning';
  message: string;
  duration?: number;
  position?: 'top' | 'bottom' | 'center';
  icon?: ToastIcon;
  customStyle?: StyleProp<ViewStyle>;
  messageStyle?: StyleProp<TextStyle>;
}

type ToastIcon = {
  icon: LucideIcon | React.ComponentType<any>;
  props?: {
    size?: number;
    color?: string;
    [key: string]: any;
  };
};

📱 Platform Specific Features

The library provides optimized experiences for both platforms:

  • iOS: Native shadows, safe area handling, and smooth animations
  • Android: Material Design elevation and touch feedback
  • Both: Natural gesture interactions and proper theme integration

🔧 Technical Requirements

  • React Native >= 0.63.0
  • React >= 16.8.0
  • TypeScript >= 4.0.0 (for TypeScript users)

🤝 Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

📄 License

MIT © Rajeshwar Kashyap