Socket
Book a DemoInstallSign in
Socket

@codebayu/react-native-toast

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codebayu/react-native-toast

The Package for creating dynamic and reusable styles in React Native App

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
19
-93.69%
Maintainers
1
Weekly downloads
 
Created
Source

@codebayu/react-native-toast

A lightweight and customizable toast notification component for React Native and Expo, with simple API hooks for programmatic control.

✨ Features

  • 📌 Show toast notifications globally from anywhere in your app.
  • 🎨 Fully customizable colors & icons.
  • ⏱ Adjustable display duration and animation speed.
  • 🔄 Programmatic API with useToast hook.
  • 🪶 Lightweight & simple integration.

📦 Installation

npm install @codebayu/react-native-toast
# or
yarn add @codebayu/react-native-toast

🚀 Usage

import React from 'react';
import { Toaster } from '@codebayu/react-native-toast';
import MainComponent from './MainComponent';

export default function App() {
  return (
    <>
      <Toaster />
      <MainComponent />
    </>
  );
}

🎯 Programmatic Control

You can show or hide toasts anywhere using the useToast hook.

import React from 'react';
import { useToast } from '@codebayu/react-native-toast';
import { Button } from 'react-native';

export default function Example() {
  const { showToast, hideToast } = useToast();

  return (
    <>
      <Button
        title="Show Success Toast"
        onPress={() =>
          showToast('Operation successful', 'success', { duration: 3000 })
        }
      />
      <Button title="Hide Toast" onPress={() => hideToast()} />
    </>
  );
}
}

🛠 API (useToast)

showToast(message, type?, options?)

  • message (string) – The text to display.
  • type (“warning” | “success” | “error”) – Defaults to "warning".
  • options.duration (number) – Override display duration.
  • options.animationDuration (number) – Override animation speed.

hideToast(callback?)

  • callback (function) – Optional callback after toast is dismissed.

License

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

Keywords

react-native

FAQs

Package last updated on 15 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.