built for project that i use vanilla Javascript or typescript that I do not want to use extra libraries with it
- Copy easy-toast.js to your project
- Copy easy-toast.css to your project
- add
<div id="toast"></div>
at the bottom of you page - call function easyToast(Message, Position, type, Duration)
- Message: string
- position: string
- top
- bottom
- left
- right
- top left
- top right
- bottom left
- bottom right
- type: string
- success
- warning
- error
- Duration: number
- in seconds
- if you did not add it it will be 3 seconds by default
Error/Warning | Success |
---|---|
![]() |
![]() |
- Show Toast
- Select place to show toast
- Show stack of toasts
- set timer of the toasts
- Show timer under the toast
- Add SVG logos depend on user request
- OnClick close toast
Note: now you can only show one toast at a time