Socket
Book a DemoInstallSign in
Socket

@ajoelp/toast

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ajoelp/toast

Customizable toast notifications for react

1.1.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

React Toast Notifications

npm Test

Getting Started

npm install @ajoelp/toast

Install the toast wrapper in your root app file.

import React from 'react';
import { ToastWrapper } from '@ajoelp/toast';

function App(){
  return <ToastWrapper />
}

Trigger toast notifications from anywhere in your application

import { toast } from '@ajoelp/toast';


toast("This is the toast message", {
  type: 'success' | 'error' | 'info' | 'warning',
  isHtml: true,
  delay: 1500
})

// Or use the typed helpers

toast.info("This is the toast message")
toast.success("This is the toast message")
toast.error("This is the toast message")
toast.warning("This is the toast message")

Override the toast message component

import React from 'react';
import { ToastWrapper } from '@ajoelp/toast';

function CustomContainer({ close, message, active, options}){
  return (
    <p>{message}</p>
  )
}

function App(){
  return <ToastWrapper toastContainer={CustomContainer} />
}

FAQs

Package last updated on 29 Dec 2020

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.