svelte-alerter-component
Easily add custom alerts to your svelte app
Usage
Add it to your svelte project:
$ npm i svelte-alerter-component --save
Then, pop it into the component that suites you:
Then, from any page or component you need to, create a new alert:
; title: "Like this alert?" // or a svelte component instance style: "background: green; border-radius: 1px;" // Optional. You can also style alerts with this css selector: .svelte-alerter-component.alert time: 3000 // Alert will disapear in 3 seconds. If no value is specified, the alert will not disapear automaticly {console} // If a value is specified, an undo button will apear on the alert. You can style this button with .svelte-alerter-component.undo { console} // or let myAlert = title: "My Alert"myAlert; // Show the alertmyAlert; // Hide the alertmyAlert; // Remove the alert
Help
Never be afraid to ask: emooring@protonmail.com or Vehmloewff#0724
Bugs
Found an problem? Submit an issue or ping me on Discord: Vehmloewff#0724.