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

@zuilib/toast

v0.1.0

Published

Toast notifications for ZUI component library - built on sonner.

Readme

@zuilib/toast

Toast notifications for ZUI — a thin wrapper around Sonner using ZUI design tokens.

When to use

  • Transient success/error/info feedback after user actions
  • Promise-based loading → success/error flows
  • You already load @zuilib/components/styles.css (toasts inherit token variables)

Prerequisites

| Package | Version | |---------|---------| | react, react-dom | ^18.0.0 | | @zuilib/components | dependency (tokens); import core styles in the app |

Installation

pnpm add @zuilib/toast @zuilib/components @headlessui/react

Monorepo:

{
  "dependencies": {
    "@zuilib/toast": "workspace:*",
    "@zuilib/components": "workspace:*"
  }
}

Import rules

| Rule | Detail | |------|--------| | Named exports from root | import { Toaster, toast } from '@zuilib/toast' | | Styles subpath | import '@zuilib/toast/styles.css' — required for toast appearance. Every value in it is a token (--info / --success / --destructive surfaces, --spacing, --text-sm, --radius-*, --duration-fast); the buttons tint from the toast's own text colour, so a retheme moves the toasts too | | Full Sonner API | toast.success, toast.error, toast.promise, etc. are re-exported unchanged |

Exports

| Subpath | Exports | |---------|---------| | @zuilib/toast | Toaster, ToasterProps, toast, Toast, ToastOptions | | @zuilib/toast/styles.css | Toast-specific CSS (import once) |

Quick start

// main.tsx or App.tsx
import '@zuilib/components/styles.css'
import '@zuilib/toast/styles.css'
import { Toaster, toast } from '@zuilib/toast'

export function App() {
  return (
    <>
      <Toaster />
      <YourRoutes />
    </>
  )
}

// Any child component
function SaveButton() {
  return (
    <button onClick={() => toast.success('Saved')}>Save</button>
  )
}

API

Toaster

Mount once at the app root (sibling to your app tree, not inside a portal-heavy subtree that unmounts).

<Toaster
  theme="light"           // 'light' | 'dark' | 'system'
  position="bottom-right"
  duration={4000}
  closeButton
/>

ToasterProps extends Sonner’s ToasterProps with theme defaulting to 'light'. All Sonner Toaster props pass through.

toast

Re-exported from sonner:

| Call | Appearance | |------|------------| | toast('Message') | Neutral / info (card-like) | | toast.success('Done') | Uses --success tokens | | toast.error('Failed') | Uses --destructive tokens | | toast.warning, toast.info, toast.loading, … | Sonner variants |

toast('Title', {
  description: 'Details',
  duration: 3000,
  action: { label: 'Undo', onClick: () => {} },
})

toast.promise(save(), {
  loading: 'Saving…',
  success: 'Saved',
  error: 'Failed to save',
})

Types: Toast, ToastOptions from @zuilib/toast.

Theming

Toasts read ZUI CSS variables (--success, --destructive, --info, etc.). Override in your app:

:root {
  --success: #22c55e;
  --destructive: #ef4444;
}

Dark mode: ensure .dark is on the root element (same as @zuilib/components).

Related packages

  • @zuilib/components — global styles.css for shared tokens
  • @zuilib/form — show toast.error on submit failure

Build (maintainers)

pnpm --filter @zuilib/toast build

Tests (vitest + jsdom + axe, mirroring @zuilib/components):

pnpm --filter @zuilib/toast test
pnpm --filter @zuilib/toast typecheck