• Imperative toast API. Toasts render into the page's [data-hl-toast-region] (mount a <ToastRegion> to control where it lives); when none exists, one is appended to <body> on the first show. Safe to call during component initialization and on the server, since nothing touches the DOM until show/dismiss run.

    <script lang="ts">
    import { useToast } from '@hydrateless/svelte';

    const toast = useToast();
    </script>

    <button onclick={() => toast.show('Saved', { intent: 'success' })}>Save</button>

    Parameters

    Returns ToastApi