Socket
Socket
Sign inDemoInstall

@ajoelp/toast

Package Overview
Dependencies
83
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ajoelp/toast

Customizable toast notifications for react


Version published
Weekly downloads
11
increased by1000%
Maintainers
1
Install size
9.15 MB
Created
Weekly downloads
 

Readme

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

Last updated on 29 Dec 2020

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc