Need help with svelte-notifications?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

beyonk-adventures
196 Stars 19 Forks 77 Commits 9 Opened issues

Description

Svelte toast notifications component that can be used in any JS application

Services available

!
?

Need anything else?

Contributors list

Beyonk

Svelte Notifications

js-standard-style Svelte v3

Svelte Notifications component

  • Uses SvelteKit 🎉
  • v3 compatible
  • uses stores for completely hassle free operation
  • Can persist across full page reloads!

Demo

A Demo of this component is available.

Alternatively, check the project out from github and

npm run dev
.

Usage

npm i -D @beyonk/svelte-notifications

Show message

Notification types

You can call multiple types of notification:

const options = {
  timeout: 3000, // milliseconds
  persist: false // automatic timeout (ignores above)
}

notifier.show('danger', message, options) notifier.danger(message, options), notifier.warning(message, options), notifier.info(message, options), notifier.success(message, options)

Persisting across apps

Your notifications can persist across multiple apps / page reloads, as long as they use this library. This is useful for a scenario where you show a notification and then redirect the browser to a different application, or trigger a full reload of the page.

This is completely automatic and uses session storage.

To ensure that notifications don't persist across apps where they should not, set the

sessionKey
attribute to something unique to each app.

Notification themes

You can customise the themes:

Show message

Custom types

Show message

Timeouts

You can set a default timeout:

Show message

Custom timeout:

You can set a timeout per message

Show message

Persist

You can make a message persist and never timeout, having a close button that the user can click to remove it.

Show message

Credits

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.