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

v0.1.2

Published

A lightweight React Native toast provider with icon support, multiple variants, and TypeScript definitions.

Readme

react-native-modern-toast

A lightweight, customizable React Native toast library with support for:

  • 🚀 Top, Center & Bottom Toast Positions
  • 🎨 Custom Background Colors
  • 📏 Custom Height
  • 🖼 Custom Icons
  • ⏱ Auto Dismiss Duration
  • 📱 Works Identically on Android & iOS
  • ⚡ No Native Dependencies
  • 🔷 TypeScript Support
  • 🎯 Multiple Toast Variants

Installation

npm install react-native-modern-toast

or

yarn add react-native-modern-toast

Setup

Wrap your app with ToastProvider.

Expo Router

import { ToastProvider } from "react-native-modern-toast";

export default function RootLayout() {
  return (
    <ToastProvider>
      <Stack />
    </ToastProvider>
  );
}

React Native

import { ToastProvider } from "react-native-modern-toast";

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

Usage

import { useToast } from "react-native-modern-toast";

export default function HomeScreen() {
  const toast = useToast();

  return (
    <Button
      title="Show Toast"
      onPress={() =>
        toast?.showToast({
          title: "Success",
          message: "Profile updated successfully",
          variant: "success",
        })
      }
    />
  );
}

Top Toast

toast?.showToast({
  title: "Success",
  message: "Top Toast",
  variant: "success",
  position: "top",
});

Center Toast

toast?.showToast({
  title: "Information",
  message: "Center Toast",
  variant: "info",
  position: "center",
});

Bottom Toast

toast?.showToast({
  title: "Warning",
  message: "Bottom Toast",
  variant: "warning",
  position: "bottom",
});

Variants

Success

toast?.showToast({
  message: "Success Toast",
  variant: "success",
});

Error

toast?.showToast({
  message: "Error Toast",
  variant: "error",
});

Warning

toast?.showToast({
  message: "Warning Toast",
  variant: "warning",
});

Info

toast?.showToast({
  message: "Info Toast",
  variant: "info",
});

Modern

toast?.showToast({
  message: "Modern Toast",
  variant: "modern",
});

Custom Background Color

toast?.showToast({
  title: "Custom",
  message: "Custom Color Toast",
  backgroundColor: "#3251A0",
});

Custom Height

toast?.showToast({
  message: "Large Toast",
  height: 90,
});

Custom Icon

toast?.showToast({
  title: "Success",
  message: "Uploaded Successfully",
  icon: require("./assets/success.png"),
});

Network Image

toast?.showToast({
  title: "Profile",
  message: "Image Loaded",
  icon: "https://example.com/icon.png",
});

Use type alias for variant

toast?.showToast({
  title: "Info",
  message: "Type alias works",
  type: "info",
  position: "center",
  time: 8,
  icon: "https://example.com/info.png",
});

Custom Duration

toast?.showToast({
  message: "Will hide after 5 seconds",
  duration: 5000,
});

Custom Time (seconds)

toast?.showToast({
  message: "Will hide after 10 seconds",
  time: 10,
});

Custom Top Padding

toast?.showToast({
  message: "Top Padding",
  position: "top",
  topPadding: 100,
});

Custom Bottom Padding

toast?.showToast({
  message: "Bottom Padding",
  position: "bottom",
  bottomPadding: 100,
});

API Reference

| Prop | Type | Default | | --------------- | ----------------------------------------- | ------------- | | title | string | undefined | | message | string | required | | variant | success | error | warning | info | modern | info | | type | success | error | warning | info | modern | info | | position | top | center | bottom | top | | duration | number | 3000 | | time | number | undefined | | backgroundColor | string | variant color | | height | number | 70 | | topPadding | number | 50 | | bottomPadding | number | 40 | | icon | ImageSourcePropType | string | undefined |


TypeScript

Fully typed and TypeScript ready.

import { ToastOptions } from "react-native-modern-toast";

Features

✅ Android Support

✅ iOS Support

✅ Expo Support

✅ React Native CLI Support

✅ TypeScript Support

✅ Custom Icons

✅ Custom Height

✅ Custom Colors

✅ Top / Center / Bottom Position

✅ Lightweight

✅ No Native Modules


License

MIT

Neeraj Singh