Socket
Socket
Sign inDemoInstall

simple-toast-messages

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-toast-messages

A simple TypeScript package that builds up a messaging system.


Version published
Weekly downloads
8
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

simple-toast-messages

npm version GitHub issues GitHub forks GitHub stars GitHub license npm CodeFactor TypeScript

A simple TypeScript package that builds up a toast messaging system.

Installation

npm install simple-toast-messages

Usage

Possible Imports

// default import
import SimpleToastMessages from 'simple-toast-messages';

// named imports
import { SimpleToastMessages, stm, T, PositionEnum } from 'simple-toast-messages';

Example

// get the instance
const msg = SimpleToastMessages.getInstance();

// fire a success message with a timeout of 1 second and position top left
msg.success(message, {
  timeOut: 1000,
  position: PositionEnum.TOP_LEFT,
});

// fire a simple error message
msg.error(message);

// fire a info message with a timeout of 3 seconds and position bottom left
msg.info(message, {
  timeOut: 3000,
  position: PositionEnum.BOTTOM_LEFT,
  opacity: 0.8,
});

// fire a warning message with a timeout of 5 seconds and position bottom center
msg.warning(message, {
  timeOut: 5000,
  position: PositionEnum.BOTTOM_CENTER,
  opacity: 0.8,
});

Example Example Example Example

License

MIT

Keywords

FAQs

Last updated on 11 Jul 2023

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