New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-toast-messages

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-toast-messages

A simple TypeScript package that builds up a messaging system.

2.0.2
latest
Source
npm
Version published
Maintainers
0
Created
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

TypeScript

FAQs

Package last updated on 30 Oct 2024

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