toastwind
v0.0.43
Published
Downloads
154
Maintainers
Readme
Toastwind!
Toastwind is tiny library to show toast on your website.
1. Installation
npm i toastwind
2. Import Project
import Toast from "toastwind"
import "toastwind/dist/style.css"
3. Usage
Toast.show("Success, Data saved!")
4. Option you can customize toast using option parameter
Toast.show("Error, Data not found",
{
timeout : 3000,
status : 'error', // success | error
position : 'top right', // top | bottom | left | right
darkMode : false // true | false
})
5. Demo Live Demo: Codepen
6. CDN Usage
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/toastwind/dist/style.css">
<script src="https://cdn.jsdelivr.net/npm/toastwind"></script>
<script>
Toast.show("Success, Data saved!")
</script>
7. Methods
| method name | description | | ------------- |:-------------:| | show(text : string, option?) | show toast | | setDefault(option?) | set default of option |
Thank You
This library built using vite, tailwind css, flowbite component and svelte
.