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

@tudp/rn-toast

v0.1.1

Published

Animated toast message component for React Native

Readme

@tudp/rn-toast

Animated toast notifications for React Native with a simple imperative API and friendly defaults.

Features

  • 🔔 Imperative Toast.show / Toast.hide API that works anywhere in your app tree
  • 🎨 Out-of-the-box success, error, and info layouts with matching leading icons
  • ⚙️ Configurable defaults for position, auto-hide timing, callbacks, and styles
  • 🧩 Extensible config prop that lets you render any custom toast component
  • 🪶 Zero extra setup for consumers — no SVG transformers or native modules required

Installation

yarn add @tudp/rn-toast
# or
npm install @tudp/rn-toast

The package depends on react and react-native which must already exist in your project.

Getting Started

  1. Render the <Toast /> component once near the root of your app (it can also live inside portals/modals if you need multiple instances).
  2. Call Toast.show from anywhere to display a notification. The latest mounted toast instance receives the command.
import React from 'react';
import { Button, SafeAreaView } from 'react-native';
import Toast from '@tudp/rn-toast';

export default function App() {
  return (
    <SafeAreaView style={{ flex: 1 }}>
      <Button
        title="Show success"
        onPress={() =>
          Toast.show({
            type: 'success',
            title: 'Saved',
            message: 'Your profile has been updated.',
          })
        }
      />

      <Toast />
    </SafeAreaView>
  );
}

Hide the current toast explicitly:

Toast.hide();

API

<Toast /> props

All props are optional; values become defaults for every toast shown via Toast.show.

| Prop | Type | Default | Description | | --- | --- | --- | --- | | type | 'success' | 'error' | 'info' | string | 'success' | Default toast type | | position | 'top' | 'bottom' | 'top' | Where the toast slides from | | autoHide | boolean | true | Auto hide after visibilityTime ms | | visibilityTime | number | 4000 | Delay before auto hide | | topOffset | number | 40 | Offset from top when position="top" | | bottomOffset | number | 40 | Offset from bottom when position="bottom" | | onShow | () => void | noop | Called whenever any toast is shown | | onHide | () => void | noop | Called whenever any toast hides | | onPress | () => void | noop | Called when the toast body is pressed | | config | ToastConfig | built-ins | Map of toast type to renderer |

Toast.show(options)

Displays a toast. options extends the props above with per-toast overrides plus:

  • title?: string
  • message?: string
  • titleStyle?: StyleProp<TextStyle>
  • messageStyle?: StyleProp<TextStyle>
  • props?: any → forwarded to custom renderer

Toast.hide()

Immediately hides the currently visible toast.

Custom Toast Layouts

Provide a config object to <Toast /> or pass a type with the same key to Toast.show.

const config = {
  warning: ({ title, message, hide }) => (
    <WarningToast
      title={title}
      message={message}
      onDismiss={hide}
    />
  ),
};

<Toast config={config} />;

Toast.show({
  type: 'warning',
  title: 'Heads up',
  message: 'You are almost out of storage.',
});

Built-in Toasts

The library exports ready-to-use components if you want to render them directly:

import { SuccessToast, ErrorToast, InfoToast } from '@tudp/rn-toast';

Each ships with a colored leading icon that matches the toast type.

Development

yarn install
yarn lint
yarn test

yarn prepare builds distribution files into lib/ (ignored by git but picked up during npm publish).

License

MIT