@jill64/svelte-toast
v1.3.53
Published
π Pre-Themed Responsive Toast Notification
Downloads
45,508
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 on:click={onSuccess}> Success </button>
<button on:click={onError}> Error </button>
<button on:click={onPromise}> Promise </button>