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

v1.2.0

Published

A zero-dependency, customizable toast component for React Native and Expo.

Readme

react-native-lottie-toast

A zero-dependency, customizable toast notification component for React Native and Expo. Built entirely using the Animated API—no external packages!

✨ Features

  • Zero dependencies - No third-party libraries required!
  • 🎨 Fully customizable - Custom background color, text color, and emoji icon
  • Auto-dismiss and tap-to-dismiss - Smart dismissal options
  • 🚀 Smooth animations - Powered by React Native's Animated API
  • 📱 Expo compatible - Works seamlessly with Expo and bare React Native
  • 🪶 Lightweight - Minimal footprint on your app

📦 Installation

Using npm

npm install react-native-lottie-toast

Using yarn

yarn add react-native-lottie-toast

Compatibility

  • React Native (v0.68.0+)
  • Expo (SDK 45+)
  • TypeScript ready
  • ✅ Works with both npm and yarn

🚀 Usage

Basic Example

import React, { useState } from "react";
import { View, Button } from "react-native";
import { Toast } from "react-native-lottie-toast";

export default function App() {
  const [showToast, setShowToast] = useState(false);

  return (
    <View>
      <Button title="Show Toast" onPress={() => setShowToast(true)} />

      <Toast
        visible={showToast}
        message="Hello! This is a toast message"
        icon="✅"
        backgroundColor="#4CAF50"
        textColor="#fff"
        duration={3000}
        onClose={() => setShowToast(false)}
      />
    </View>
  );
}

Multiple Toast Types

import React, { useState } from "react";
import { View, Button } from "react-native";
import { Toast } from "react-native-lottie-toast";

export default function App() {
  const [successToast, setSuccessToast] = useState(false);
  const [errorToast, setErrorToast] = useState(false);

  return (
    <View>
      <Button title="Success" onPress={() => setSuccessToast(true)} />
      <Button title="Error" onPress={() => setErrorToast(true)} />

      {/* Success Toast */}
      <Toast
        visible={successToast}
        message="Operation completed successfully!"
        icon="✅"
        backgroundColor="#4CAF50"
        textColor="#fff"
        duration={3000}
        onClose={() => setSuccessToast(false)}
      />

      {/* Error Toast */}
      <Toast
        visible={errorToast}
        message="Something went wrong!"
        icon="❌"
        backgroundColor="#F44336"
        textColor="#fff"
        duration={3000}
        onClose={() => setErrorToast(false)}
      />
    </View>
  );
}

Full Example

Check out the complete working example with multiple toast types in the example/App.js file.

📖 API Reference

Props

| Prop | Type | Default | Description | | ----------------- | ---------- | -------------------- | -------------------------------------------- | | visible | boolean | false | Controls the visibility of the toast | | message | string | 'This is a toast!' | The message to display in the toast | | icon | string | '✅' | Emoji or text icon to display | | backgroundColor | string | '#333' | Background color of the toast | | textColor | string | '#fff' | Color of the message text | | duration | number | 3000 | Duration in milliseconds before auto-dismiss | | onClose | function | () => {} | Callback function when toast closes |

💡 Examples

Success Toast

<Toast
  visible={showToast}
  message="Saved successfully!"
  icon="✅"
  backgroundColor="#4CAF50"
  textColor="#fff"
  duration={3000}
  onClose={() => setShowToast(false)}
/>

Error Toast

<Toast
  visible={showToast}
  message="Failed to save changes"
  icon="❌"
  backgroundColor="#F44336"
  textColor="#fff"
  duration={3000}
  onClose={() => setShowToast(false)}
/>

Warning Toast

<Toast
  visible={showToast}
  message="This action cannot be undone"
  icon="⚠️"
  backgroundColor="#FF9800"
  textColor="#fff"
  duration={3000}
  onClose={() => setShowToast(false)}
/>

Info Toast

<Toast
  visible={showToast}
  message="New updates available"
  icon="ℹ️"
  backgroundColor="#2196F3"
  textColor="#fff"
  duration={3000}
  onClose={() => setShowToast(false)}
/>

Custom Toast

<Toast
  visible={showToast}
  message="🎉 Welcome to the app!"
  icon="🚀"
  backgroundColor="#9C27B0"
  textColor="#FFD700"
  duration={4000}
  onClose={() => setShowToast(false)}
/>

🎯 Features in Detail

  • Auto-dismiss: Toast automatically dismisses after the specified duration
  • Tap-to-dismiss: Users can tap the toast to dismiss it immediately
  • Smooth animations: Uses React Native's Animated API for smooth slide-in/out animations
  • Customizable: Fully customizable colors, icons, messages, and duration
  • Zero dependencies: No external libraries required
  • Lightweight: Minimal footprint on your app

📝 License

MIT

🤝 Contributing

Contributions, issues, and feature requests are welcome!

👨‍💻 Author

Vijay Kishan