2.0.1 • Published 11 months ago

simple-toast-messages v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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

1.1.0

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago