Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-toasts

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-toasts

Simple toast popup for React

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-8.93%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-toasts

Simple toast message popup for React ⚛️

NPM JavaScript Style Guide

Install

npm install --save react-simple-toasts

Usage

a very simple use

toast(message);
// or
toast(message, (millisecond = 3000));
// or
toast(message, { time: 3000, ...options });
import React from 'react';
import toast from 'react-simple-toasts';

const Example = () => (
  <div className="example">
    <button onClick={() => toast('Hello toast!')}>Toast</button>
    <button onClick={() => toast('Message', 1000)}>One-second</button>
  </div>
);

Live Demo

Options

NameTypeDefaultDescription
timenumber3000The millisecond time that the message is displayed
classNamestring''Can be used to customize styles
clickablestringfalseCan click the message
onClick(event) => voidSet the handler to handle click event
Must be used with clickable: true

Config Defaults

You can specify config defaults.

index.js

import { toastConfig } from 'react-simple-toasts';

toastConfig({
  time: 5000,
  className: 'my-toast-message',
});
NameTypeDefaultDescription
timenumber3000The millisecond time that the message is displayed.
classNamestring''Can be used to customize styles.
positionstringcenterleft, center, right


Thanks

Support it by joining stargazers for this repository. :star:

License

MIT © almond-bongbong

Keywords

FAQs

Package last updated on 03 Jun 2021

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc