toast-emoji

0.0.7Ā ā€¢Ā PublicĀ ā€¢Ā Published

<toast-emoji>

NPM

Toast emoji is a toast web component, that randomly adds an emoji { šŸ˜ } to your toast message.

How to Use

importĀ "toast-emoji";

Or

importĀ *Ā fromĀ "toast-emoji"

Or

<scriptĀ src="https://cdn.jsdelivr.net/npm/toast-emoji@0.0.1/src/index.min.js"></script>

Example

<toast-emoji
Ā Ā type="sucess"
Ā Ā message="ThisĀ isĀ aĀ demo"
Ā Ā position="bottom-left"
></toast-emoji>

See demo

Attributes

  • All attributes are optional
Attribute Type Description Default
type String The type of toast - can be (success, error, warn, light) ""
message String The message of toast Hey there!
position String The position of toast on page - can be (top-left, top-right, top-center, left, right, center, bottom-left, bottom-right, bottom-center) postion-center
hidden Boolean The hiding status of the toast. false
timeout Integer The time before toast get hidden in millisecons. when empty - (Always visible until user closes toast). ""

Events

  • closed - event is emitted whenever toast get close by user action or by timeout
varĀ toastĀ =Ā document.createElement("toast-emoji");
Ā 
toast.addEventListener("closed",Ā function()Ā {
Ā Ā alert();
});

Screenshots

  • Dark mode - default toast-emoji
  • Light mode toast-emoji
  • Error mode toast-emoji

Dependentsā€‚(0)

Package Sidebar

Install

npm i toast-emoji

Weekly Downloads

5

Version

0.0.7

License

MIT

Unpacked Size

82.2 kB

Total Files

10

Last publish

Collaborators

  • marvinified