maya-notice

1.0.3 • Public • Published

maya-notice

A simple, lightweight notification plugin

install

npm install maya-notice --save

usage

quick use

import notice from "maya-notice";
import "maya-notice/src/style.css";

notice.info("hello world");
notice.success("hello world");
notice.warning("hello world");
notice.error("hello world");
notice.loading("Loading...please wait");

Use more options

notice.open({
    type : 'error',
    content : 'hi how are you',
    duration : 5000,
    maskable : true,
    onClose : function(){
        alert('closed');
    }
});
notice.close();

execute callback function after closing

notice.loading("Loading...",{
    onClose:function(){
        alert('closed');
    }
});

options

Properties Type Default Description
content String "" Content string
type String "info" Optional values are:info,success,error,warning,loading
duration Number 2500 Display duration
maskable Boolean false Whether to display the background mask layer
onClose Function function(){} Callback function after closing

Readme

Keywords

Package Sidebar

Install

npm i maya-notice

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

18 kB

Total Files

8

Last publish

Collaborators

  • tongwoo