1.1.1 • Published 4 years ago

xmd-toast v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Install ⚙️

npm i xmd-toast

Using 💻

import toast from "xmd-toast";

// HERE IS THE MAGIC!
toast({ text:"Helo World" })

// BETTER TOAST
toast({
  text:"Alert text",
  actionText: "Ok",
  fixed:false,
  time:5000,
  action:() => console.log("Message from action"),
  onHide:() => console.log("Hide toast"),
})

// TRY SHOW TOAST AFTER TOAST
toast({
  text:"Show toast",
  actionText: "Throw",
  action:() => {
    toast({text: "New toast"})
  }
})

TypeScript Compatible 😀

Options:

PropertyTypeDefaultDescription
TextString"Alert"The main text of the toast
actionTextString"Confirm"The text of the action button
onHideFunctionundefinedCall when the toast left the screen
actionFunctionundefinedCall on action button click event
fixedBooleanfalseTrue: Toast never hide / False: Toast Hide
timeNumber5000The lifetime of toast

Preview 👀

CodeSandbox

1.1.1

4 years ago

1.0.2

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago