Socket
Book a DemoInstallSign in
Socket

react-native-toastier

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-toastier

A Fully Customizable Toast Component for React Native.

latest
npmnpm
Version
2.0.4
Version published
Weekly downloads
1.3K
50.98%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-toastier

A Fully Customizable Toast Component for React Native.

NPM Version NPM Downloads MIT License

Demo

Installation

Install the package via npm or yarn

  npm install react-native-toastier
  or
  yarn add react-native-toastier

Usage/Examples

Wrap your app in ToastProvider to provide context for the toast service.

import { ToastProvider } from 'react-native-toastier'

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

Use the ToastService to display a toast message anywhere in the app.

import { ToastService } from 'react-native-toastier';

export default function Component() {

   useEffect(() => { 
      ToastService.show({ 
         message: "Hello Toast" 
      }) 
   }, []);
   
   // Rest of the code....
}

Toast Service

To show success message

ToastService.show({ 
         message: "Hello Toast" 
      }) 

To show error message

ToastService.showError({ 
         message: "Hello Toast" 
      }) 

To show info message

ToastService.showInfo({ 
         message: "Hello Toast" 
      }) 

To show warning message

ToastService.showWarning({ 
         message: "Hello Toast" 
      }) 

Custome Toast

ToastService.show({ 
   message: 'Hello', 
   children: <Custom/>, 
   textStyle: { color: '#000' }, 
   contentContainerStyle: { borderStartWidth: 5, backgroundColor: '#fff', paddingLeft: 12, flex: 1, borderStartColor: theme.colors.green[300]} 
})

Props

Props can be passed from the provider (will apply to all toast) as well as from the toast service (will apply to a particular toast).

ToastProvider Props

PropData typeDefaultDescription
childrenReactNodeRequired.The children for context provider.
themeTheme-Update defualt toast theme.
animationstringzoomInThe animation type to taost message.
positionstringtopToast meesage position top, bottom.
durationnumber15000How long to display the Toast message.
contentContainerStyleViewStyle-To update toast message outter container style.
textContainerStyleViewStyle-To update toast message container style.
textStyleTextStyle-To update toast message test style.

Toast Service Options

PropData typeDefaultDescription
messagestring-The message to show.
childrenReactNode-The children for custom toast.
leftReactNode-The left component for a toast.
rightReactNode-The right component for a toast.
themeTheme-Update default toast theme for particular toast.
animationstringzoomInUpdate animation for particular toast.
positionstringtopUpdate position for particular toast.
durationnumber15000Update duration for particular toast.
contentContainerStyleViewStyle-Update outter container style for particulat toast.
textContainerStyleViewStyle-Update message container style for particulat toast.
textStyleTextStyle-Update toast message test style for particulat toast.

Donation

If you find my projects and contributions helpful, consider supporting me. Your support means a lot and helps me continue creating and sharing more cool stuff.

Buy Me A Coffee

Hire

I'm a skilled React and React Native developer ready to help with your project. Let's create something great together! Contact me hardikviradiya27@gmail.com

License

MIT

Keywords

toast

FAQs

Package last updated on 06 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