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

v1.0.0

Published

A customizable, theme-ready toast system for React Native with queueing, safe-area support, swipe to dismiss, and modal compatibility.

Readme

🌸 react-native-dream-toast

React Native Smart Toast / React Native Dream Toast

A beautiful, customizable, and lightweight toast notification system for React Native. Supports theming, queueing, global config, icons, and full TypeScript support.


✨ Features

  • 🔔 Minimal toast system for Android & iOS
  • ⏳ Auto-dismiss with custom duration
  • 🔃 Queueing support (FIFO)
  • 🎨 Theming with multiple preset styles
  • ⚙️ Global config with setToastConfig()
  • 🧩 Custom renderers
  • 📦 Written in TypeScript

Toast Demo


⚠️ Peer Dependencies

Make sure the following packages are installed in your project:

npm install react-native-safe-area-context
# or
yarn add react-native-safe-area-context

📦 Installation

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

🚀 Quick Start

1. Wrap your app with the ToastProvider

import { ToastProvider } from 'react-native-dream-toast';

export default function App() {
  return (
    <ToastProvider>
      <YourApp />
    </ToastProvider>
  );
}

2. Show a toast anywhere

import { Toast } from 'react-native-dream-toast';

Toast.show({
  message: 'Hello from Dream Toast!',
  type: 'success',
});

🛠 Global Config: setToastConfig()

You can globally configure default toast styles, behavior, and position:

import { setToastConfig } from 'react-native-dream-toast';

setToastConfig({
  queue: true,
  topOffset: 40,
  bottomOffset: 40,
  toastStyle: {
    success: { backgroundColor: '#1b5e20' },
    error: { backgroundColor: '#b71c1c' },
    warning: { backgroundColor: '#f57f17' },
    info: { backgroundColor: '#01579b' },
  },
  textStyle: {
    success: { color: '#fff', fontWeight: 'bold' },
    error: { color: '#fff' },
    warning: { color: '#000' },
    info: { color: '#fff', fontStyle: 'italic' },
  },
});

💡 Usage Examples

Basic Toast

Toast.show({
  message: 'This is an info toast!',
  type: 'info',
  autoClose: true,
  duration: 3000,
});

Custom callback

Toast.show({
  message: 'This will log on close',
  type: 'error',
  onClose: () => console.log('Toast closed!'),
});

Add Custom Icons for Visual Feedback

Toast.show({
  message: 'Success!',
  icon: require('./assets/success.png'), // or JSX
});

🔧 Props

| Prop | Type | Default | Description | |--------------|-----------------------------------------------------------|---------------|----------------------------------------| | message | string | – | The toast message to display | | type | 'success' \| 'error' \| 'info' \| 'warning' \| 'default'| 'default' | Type of toast | | icon | ReactNode \| number | – | Optional icon (image or JSX) | | position | 'top' \| 'bottom' | 'top' | Toast position | | autoClose | boolean | true | Auto-dismiss toast | | duration | number | 3000 | Auto-close delay in milliseconds | | onClose | () => void | – | Callback when toast is dismissed | | toastStyle | ViewStyle | – | Override toast container style | | textStyle | TextStyle | – | Override text style | | styleName | 'beautyToast' \| 'elegantToast' \| ... | 'beautyToast'| Style preset group | | queue | boolean | true | Queue or override toasts |

🎨 Available Preset Toast Styles

react-native-dream-toast includes several pre-configured style themes for a quick start:

  • default
  • beautyToast
  • paperToast
  • vintageToast

Toast Style Demo

🔌 Custom Renderer (Override or Add Any Type)

You can override the UI of any existing toast type (like 'success', 'error', 'info', etc.) or define your own custom toast types using the renderers option in Toast.configure():

import { Toast } from 'react-native-dream-toast';

Toast.configure({
  renderers: {
    // 🔁 Override built-in "success" toast
    success: ({ message, onClose }) => (
      <Pressable
        onPress={onClose}
        style={{ backgroundColor: '#388e3c', padding: 12, borderRadius: 10 }}
      >
        <Text style={{ color: 'white', fontWeight: 'bold' }}>{message}</Text>
      </Pressable>
    ),

    // 🔁 Override built-in "error" toast
    error: ({ message, onClose }) => (
      <Pressable
        onPress={onClose}
        style={{ backgroundColor: '#d32f2f', padding: 12, borderRadius: 10 }}
      >
        <Text style={{ color: '#fff' }}>{message}</Text>
      </Pressable>
    ),

    // ✨ Define a new toast type "fancy"
    fancy: ({ message, onClose }) => (
      <Pressable
        onPress={onClose}
        style={{
          backgroundColor: '#6a1b9a',
          padding: 16,
          borderRadius: 16,
          borderWidth: 2,
          borderColor: '#ab47bc',
        }}
      >
        <Text style={{ color: '#fff', fontSize: 18 }}>💎 {message}</Text>
      </Pressable>
    ),
  },
});

Usage Example

Toast.show({ type: 'success', message: 'Success with custom UI!' });
Toast.show({ type: 'fancy', message: 'This is a fancy toast 🎉' });

✅ You can customize or completely replace the UI for any toast type, and even introduce your own new types with their own appearance and behavior.

📚 TypeScript Support

All exports are fully typed:

import { ToastProps, setToastConfig } from 'react-native-dream-toast';

🧠 Best Practices

1. Use queue: true for Sequential Toasts

If you're triggering multiple toasts in quick succession, enable the queue system:

setToastConfig({ queue: true });

2. Wrap Your App in <SafeAreaProvider>

To ensure proper positioning of toasts (especially on devices with notches or insets), wrap your root component like this:

import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';

export default function App() {
  return (
    <SafeAreaProvider>
      <SafeAreaView style={{ flex: 1 }}>
        {/* your navigation or app content */}
      </SafeAreaView>
    </SafeAreaProvider>
  );
}

This ensures toasts correctly calculate top/bottom offsets using the device’s safe area insets.


🧑 Author

Made with ❤️ by Antos Maman

📄 License

MIT Copyright (c) 2025 Antos Maman