dssoca docs

Toaster

Toast notification host.

Mount once near the app root; drive it imperatively with the `toast` API. Toasts announce politely via a live region.

Demo

live · storybook Open in Storybook

Demo loads from http://localhost:6006. Run pnpm storybook for it to render locally.

Usage

svelte
<script>
  import { Toaster, toast } from 'dssoca';
</script>

<Toaster />
<button onclick={() => toast.success('Saved!')}>save</button>

Pair with the imperative API: `toast.success(msg)`, `toast.error(msg)`, `toast.info(msg)` (optional timeout ms). `toasts` is the underlying reactive store.

Props

PropTypeDefaultDescription
size'sm' | 'md' | 'lg'Per-instance size override; inherits the ancestor `data-size-variant` when unset.