https://bridge-notification.netlify.app
npm install --save bridge-svelte-notification
// App.svelte
<script>
import BridgeNotify from "bridge-svelte-notification";
<main>
<BridgeNotify />
...
</main>
</script>
// ChildrenComponent.svelte
<script>
import { notify } from "bridge-svelte-notification";
function show(position) {
notify({
message: "Bridge Notification is Awesome 😍",
type: 'success',
duration: 3000,
position: 'center',
animate: {
y: 100,
x: 0,
duration: 500
}
});
}
</script>
<button on:click={show}> Show Notification </button>
// ChildrenComponent.svelte
import { notify } from "bridge-svelte-notification";
function show(position) {
notify({
message: "Bridge Notification is Awesome 😍",
type: 'success',
duration: 3000,
position: 'center',
animate: {
y: 100,
x: 0,
duration: 500
},
style:'backgound-color:blue;color:black'
});
}
</script>
<button on:click={show}> Show Notification </button>