@jill64/svelte-toast
v2.1.6
Published
π Pre-Themed Responsive Toast Notification
Downloads
62,625
Readme
<Toaster {palette} />
<!-- +page.svelte -->
<script>
import { toast } from '@jill64/svelte-toast'
const onSuccess = () => toast.success('Success', {
// Optional Toast Config
})
const onError= () => toast.error('Error', {
// Optional Toast Config
})
const onPromise = () =>
toast.promise(
// Your Promise
,
{
success: 'Success',
error: 'Error',
loading: 'Loading'
},
{
// Optional Toast Config
}
)
</script>
<button onclick={onSuccess}> Success </button>
<button onclick={onError}> Error </button>
<button onclick={onPromise}> Promise </button>