All Projects → moharnadreza → react-toast

moharnadreza / react-toast

Licence: MIT License
Minimal toast notifications for React.

Programming Languages

typescript
32286 projects
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-toast

Toastutils
Android 吐司框架,专治 Toast 各种疑难杂症
Stars: ✭ 2,087 (+4340.43%)
Mutual labels:  toast, toast-notifications
Notistack
Highly customizable notification snackbars (toasts) that can be stacked on top of each other
Stars: ✭ 2,562 (+5351.06%)
Mutual labels:  toast, toast-notifications
JDToaster
🍞 Toasty iOS alerts
Stars: ✭ 25 (-46.81%)
Mutual labels:  toast, toast-notifications
SteamAchievementNotifier
Steam Achievement Notifier is an Electron application that shows a customisable notification when you unlock any Steam Achievement! It uses the Steam Web API to track achievement stats in real time, and displays an achievement summary within the notification.
Stars: ✭ 77 (+63.83%)
Mutual labels:  toast, toast-notifications
React-Toast
Custom push notification (Toast) implementation under React + stayed by TailwindCSS.
Stars: ✭ 74 (+57.45%)
Mutual labels:  toast, react-toast
v-tostini
Toast plugin for Vue.js 2.x
Stars: ✭ 12 (-74.47%)
Mutual labels:  toast, toast-notifications
SimpleToast
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or MacOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals.
Stars: ✭ 131 (+178.72%)
Mutual labels:  toast, toast-notifications
tall-toasts
A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
Stars: ✭ 296 (+529.79%)
Mutual labels:  toast, toast-notifications
toaststrap
A simple, lightweight JavaScript library for showing Bootstrap 5 toast popups.
Stars: ✭ 16 (-65.96%)
Mutual labels:  toast, toast-notifications
simple-notify
Pure javascript toast notifications.
Stars: ✭ 108 (+129.79%)
Mutual labels:  toast, toast-notifications
React Toast Notifications
🍞 A toast notification system for react
Stars: ✭ 2,103 (+4374.47%)
Mutual labels:  toast, toast-notifications
neodigm55
An eclectic low-code vanilla JavaScript UX micro-library for those that defiantly think for themselves.
Stars: ✭ 14 (-70.21%)
Mutual labels:  toast, toast-notifications
bs5-utils
A JavaScript utility package for Bootstrap 5 components.
Stars: ✭ 26 (-44.68%)
Mutual labels:  toast, toast-notifications
RTL-Toast
Android Toast For RTL Applications
Stars: ✭ 16 (-65.96%)
Mutual labels:  toast, toast-notifications
angular-8-alert-notifications
Angular 8 - Alert (Toaster) Notifications
Stars: ✭ 32 (-31.91%)
Mutual labels:  toast-notifications
ComposableSweetToast
Jetpack Compose, Custom Toast, Solid Principles, Kotlin
Stars: ✭ 60 (+27.66%)
Mutual labels:  toast
Toast-for-Framework7
A toast component plugin for iOS Framework7
Stars: ✭ 41 (-12.77%)
Mutual labels:  toast
Sentinel
👀 Native notifications for League of Legends
Stars: ✭ 38 (-19.15%)
Mutual labels:  toast
MaterialToast
A fully and highly customizable material designed Toast for Android.
Stars: ✭ 31 (-34.04%)
Mutual labels:  toast
toast-swift
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞
Stars: ✭ 85 (+80.85%)
Mutual labels:  toast

React Toast

React Toast

Minimal toast notifications for React.

Get started

Quick start

Install with yarn

yarn add react-toast

Install with NPM

npm install react-toast
import { ToastContainer, toast } from 'react-toast'

const App = () => {
  const wave = () => toast('Hi there 👋')

  return (
    <div>
      <button onClick={wave}>Say hi!</button>
      <ToastContainer />
    </div>
  )
}

Demo

Demo on CodeSandbox.

Docs

Toast Container

To use react-toast, you need to put ToastContainer in a top-level component in your application. e.g. App.js

It can take some props, here's a list of them:

Props Type Description Default
position top-left | top-center | top-right | bottom-left | bottom-center | bottom-right position of toast bottom-left
delay (ms) number delay for toast 6000

Toast

There are 4 base toast type available, success, error, info and warn. For instance:

const success = () => toast.success('Message sent successfully!')

or

fetch('someRandomUrl')
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => toast.error(err.message))

Custom toast

You can display custom styled toasts, here's an example and a list of options that are available for customization:

const customToast = () =>
  toast('Morning! Have a good day.', {
    backgroundColor: '#8329C5',
    color: '#ffffff',
  })
Property Type Description Default
backgroundColor string background color of toast based on toast type, e.g. success will be green
color string color of text in toast #ffffff

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].