npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@toast-kit/svelte

v0.1.0

Published

Typed toast helper for Svelte 5 — a thin, dedupe-aware.

Downloads

32

Readme

@toast-kit/svelte

Install

npm install @toast-kit/svelte svelte-sonner

svelte ^5.0.0 is a peer dependency and must already be in your project.

Usage

Mount Toaster once, typically in your root layout, exactly as you would with svelte-sonner:

<!-- +layout.svelte -->
<script lang="ts">
	import { Toaster } from '@toast-kit/svelte';
</script>

<Toaster />
{@render children?.()}

Then call toast from anywhere:

import { toast } from '@toast-kit/svelte';

toast('Saved!');
toast.success('Profile updated');
toast.error('Something went wrong', { description: 'Please try again.' });

// Any svelte-sonner ExternalToast field works unchanged:
toast.warning('Connection unstable', { duration: Infinity, closeButton: true });

// Pass-through, undeduped:
toast.loading('Uploading…');
toast.promise(uploadFile(), { loading: 'Uploading…', success: 'Done!', error: 'Failed' });
toast.dismiss();

Duplicate grouping

Calling the same toast.* kind with the same message text updates the existing toast instead of opening a new one:

toast.warning('Sync conflict detected'); // "Sync conflict detected"
toast.warning('Sync conflict detected'); // same toast, now "Sync conflict detected × 2"

Grouping is keyed by (kind, message) and is scoped to the browser only — calling toast() during SSR (e.g. accidentally, from a server load function) never touches the grouping state, so nothing can leak across requests.

Opt out per call:

toast.error('Manual id', { id: 'my-fixed-id' }); // caller owns identity: no grouping
toast.info('Always show separately', { dedupe: false });

Control how a repeat's duration behaves:

toast.warning('Rate limited', {
	duration: 4000,
	dedupeDurationStrategy: 'extend', // 'reset' (default) | 'extend' | 'accumulate'
	dedupeExtendBy: 2000 // defaults to `duration`
});
  • 'reset' — the toast gets the full duration again on each repeat (svelte-sonner's native update-by-id behavior).
  • 'extend' — adds dedupeExtendBy once, regardless of how many repeats follow.
  • 'accumulate' — adds dedupeExtendBy again for every repeat, so a message hit 5 times stays up longer than one hit twice.

duration: Infinity (persistent toasts) is never adjusted, under any strategy. |

SSR

Grouping is a client-only concern (see above); every other export is exactly what svelte-sonner already provides, which supports SSR.

License

MIT