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

rn-toast-notifier

v1.0.3

Published

A customizable animated toast notification component for React Native

Readme

React Native Toast Notify

A lightweight, customizable animated toast notification component for React Native applications. This library provides smooth animations, multiple positions, and different types of notifications to enhance your app's user experience.

Features

  • 🚀 Smooth slide and fade animations
  • 🎨 Multiple toast types (default, success, error, warning)
  • 📍 Flexible positioning (top or bottom)
  • ⏱️ Customizable duration
  • 🎯 Auto-dismiss with callback function
  • 📱 Responsive design
  • 💫 Native animations for better performance
  • 🎨 Customizable styles for container and text
  • ✨ Optional icon support (using react-native-vector-icons)
  • ♿ Accessibility support

Installation

# Using npm
npm install rn-toast-notifier

# Using yarn
yarn add rn-toast-notifier

Optional Icon Support

To display icons in your toast notifications, you need to install react-native-vector-icons:

# or
yarn add react-native-vector-icons

Follow the react-native-vector-icons installation guide to configure it for your project.

Usage

import ToastNotification from 'rn-toast-notifier';
import { useState } from 'react';
import { Button } from 'react-native';

const App = () => {
  const [visible, setVisible] = useState(false);

  const showToast = () => {
    setVisible(true);
  };

  return (
    <>
      {visible && (
        <ToastNotification
          message="Success! Your action was completed."
          type="success"
          duration={3000}
          position="top"
          onHide={() => setVisible(false)}
          iconName="check-circle" // Optional icon
        />
      )}
      <Button title="Show Toast" onPress={showToast} />
    </>
  );
};

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | message | string | required | The text message to display in the toast | | duration | number | 3000 | Duration in milliseconds before the toast disappears | | type | string | 'default' | Type of toast: 'default', 'success', 'error', 'warning' | | position | string | 'top' | Position of toast: 'top' or 'bottom' | | onHide | function | () => {} | Callback function called when toast is hidden | | iconName | string | null | Optional icon name (e.g., 'check-circle' for success toasts) | containerStyle | object | {} | Custom styles for the toast containe | textStyle | object | {} | Custom styles for the toast message text | animationConfig | object | { duration: 300 }| Custom animation configuration (e.g., { duration: 500 })

Toast Types

The library includes four pre-styled toast types:

  • default: Gray background
  • success: Green background
  • error: Red background
  • warning: Yellow background

Examples

Success Toast

<ToastNotification
  message="Successfully saved!"
  type="success"
  duration={2000}
/>

Error Toast

<ToastNotification
  message="An error occurred"
  type="error"
  position="bottom"
/>

Warning Toast with Custom Duration

<ToastNotification
  message="Please check your input"
  type="warning"
  duration={5000}
/>

Customization

The toast notifications are styled using React Native's StyleSheet. You can customize the appearance by passing style props:

Custom Styles

Pass containerStyle and textStyle props to customize the toast's appearance.

<ToastNotification
  message="Custom styled toast"
  containerStyle={{
    backgroundColor: '#6200EE',
    borderRadius: 10,
    padding: 20,
  }}
  textStyle={{
    color: '#FFFFFF',
    fontSize: 16,
    fontWeight: 'bold',
  }}
/>

Custom Icons

Use the iconName prop to display an icon alongside the message. Icons are supported via react-native-vector-icons.

<ToastNotification
  message="Task completed!"
  type="success"
  iconName="check-circle" // MaterialIcons icon name
/>

Custom Animations

Pass an animationConfig object to customize the animation duration and behavior.

<ToastNotification
  message="Custom animation"
  animationConfig={{ duration: 500 }}
/>

Accessibility

The toast notifications are fully accessible. By default, the component includes:

  • accessible={true}

  • accessibilityRole="alert"

  • accessibilityLabel (based on the message prop)

You can override these props if needed.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you have any questions or need help, please:

  • Open an issue
  • Submit a pull request
  • Contact the maintainers

Author

Your Name