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

toastax

v5.0.0

Published

A modern, customizable, and accessible toast notification library for React applications with Glassmorphism and Liquid Glass themes

Downloads

9

Readme

ToastaX 5.0.0

ToastaX is a modern, lightweight, customizable, and accessible toast notification library for React applications. Built with JavaScript (TypeScript Supported), it provides a simple API for displaying notifications with basic themes and interactive features. Specializing in "Glassmorphism" and "Liquid Glass" themes for a sleek, contemporary UI/UX.

Features

  • Lightweight & Optimized: Minimal features for faster load times and smaller bundle size.
  • Customizable Styling: Choose from themes (light, dark, system, glass, liquid-glass).
  • Accessibility: Basic ARIA attributes.
  • Interactivity: Pause on hover, closable toasts.
  • Responsive Design: Adapts to mobile devices with dynamic positioning.
  • TypeScript Support: Fully typed with TypeScript definitions.

Installation

Install ToastaX via npm or yarn:

npm install toastax

Install peer dependencies:

npm install dompurify prop-types

Usage

Basic Setup

Import ToastaX and the Toaster component, then render the toaster in your React app:

import { Toaster, toastax } from 'toastax';
import 'toastax/dist/toastax.css';

function App() {
  return (
    <div>
      <Toaster position="top-right" theme="light" />
      <button
        onClick={() =>
          toastax.success('Operation completed!', {
            duration: 3000,
          })
        }
      >
        Show Toast
      </button>
    </div>
  );
}

export default App;

Custom ToastaX Instance

Create a custom instance with default options:

import { Toaster, ToastaX } from 'toastax';
import 'toastax/dist/toastax.css';

const toast = new ToastaX({
  position: 'bottom-right',
  theme: 'liquid-glass',
  duration: 5000,
  pauseOnHover: true,
  closable: true,
});

function App() {
  return (
    <div>
      <Toaster toastaxInstance={toast} />
      <button
        onClick={() =>
          toast.info('Info message')
        }
      >
        Show Info Toast
      </button>
    </div>
  );
}

export default App;

Configuration Options

Basic configuration options to customize toast behavior and appearance:

| Option | Type | Default | Description | |-------|------|--------|-------------| | position | 'top-left' \| 'top-center' \| 'top-right' \| 'bottom-left' \| 'bottom-center' \| 'bottom-right' | 'bottom-right' | Position of the toast container. | | theme | 'light' \| 'dark' \| 'system' \| 'glass' \| 'liquid-glass' | 'system' | Visual theme of the toast. | | duration | number | 4000 | Duration (ms) before auto-dismiss. | | closable | boolean | true | Show close button. | | pauseOnHover | boolean | true | Pause timer on hover. |

For a complete list, see the TypeScript definitions.

API Methods

ToastaX provides a simple API for managing toasts:

  • show(options: Partial<ToastOptions>): Display a toast with custom options.
  • success(message?: string \| ReactNode, options?: Partial<ToastOptions>): Display a success toast.
  • error(message?: string \| ReactNode, options?: Partial<ToastOptions>): Display an error toast.
  • warning(message?: string \| ReactNode, options?: Partial<ToastOptions>): Display a warning toast.
  • info(message?: string \| ReactNode, options?: Partial<ToastOptions>): Display an info toast.
  • dismiss(id?: number): Dismiss a specific toast by ID.
  • update(id: number, options: Partial<ToastOptions>): Update an existing toast's options.
  • destroy(): Clean up the ToastaX instance.

Styling

Customize ToastaX using CSS custom properties defined in toastax.css:

:root {
  --toastax-border-radius: 12px;
  --toastax-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  --toastax-font-size: 0.9rem;
  --toastax-gap: 14px;
}

For advanced customization, target elements with .toastax-toast.success or similar selectors.

Accessibility

ToastaX includes basic accessibility features like ARIA roles. Ensure custom content follows WCAG guidelines.

Changelog

Version 5.0.0

  • Simplified for lighter weight.
  • Added "Liquid Glass" theme.
  • Enhanced efficiency.

For support, contact the author at [email protected].