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

@xsolla/xui-b2b-toast

v0.158.0

Published

Floating, transient feedback for B2B page layouts. Toasts slide in from a fixed corner of the viewport, auto-dismiss after a few seconds, and stack vertically. Use for brief confirmations and non-blocking status messages.

Downloads

3,116

Readme

B2B Toast

Floating, transient feedback for B2B page layouts. Toasts slide in from a fixed corner of the viewport, auto-dismiss after a few seconds, and stack vertically. Use for brief confirmations and non-blocking status messages.

See also: @xsolla/xui-b2b-notification-panel for inline (non-floating) feedback that stays in place until dismissed.

Installation

yarn add @xsolla/xui-b2b-toast

Quick start

Wrap your app with ToastProvider once, then call useToast() from anywhere inside.

import { ToastProvider, useToast } from "@xsolla/xui-b2b-toast";
import { Button } from "@xsolla/xui-button";

function App() {
  return (
    <ToastProvider position="top-right" limit={3}>
      <Page />
    </ToastProvider>
  );
}

function Page() {
  const toast = useToast();
  return (
    <Button
      onPress={() =>
        toast.success({
          title: "Saved",
          description: "Your changes have been saved.",
          action: <Button onPress={() => undo()}>Undo</Button>,
        })
      }
    >
      Save
    </Button>
  );
}

API

<ToastProvider>

| Prop | Type | Default | Description | | ----------- | ---------------- | -------------- | --------------------------------------------- | | position | ToastPosition | "top-right" | Viewport corner to anchor toasts to. | | limit | number | 3 | Max simultaneously visible toasts. | | container | HTMLElement | document.body| Portal target. |

ToastPosition = "top-right" \| "top-left" \| "top-center" \| "bottom-right" \| "bottom-left" \| "bottom-center"

useToast()

const toast = useToast();
toast.alert(options);    // role=alert, default 9000ms
toast.success(options);  // default 4500ms
toast.warning(options);  // default 6500ms
toast.info(options);     // default 6500ms
toast.show(type, options);
toast.dismiss(id);
toast.dismissAll();

ToastOptions:

| Field | Type | Description | | ----------------- | --------------------- | -------------------------------------------------------- | | title | string | Title (bodyMd accent). | | description | string | Optional description (bodySm). | | action | ReactElement | Button/IconButton; tone & size are auto-applied. | | showCloseButton | boolean | Default true. | | duration | number | Auto-dismiss in ms. 0 disables. | | id | string | Stable id; reusing replaces the existing toast. | | onDismiss | () => void | Fires when toast is removed (auto, manual, or replaced). |

<Toast>

The visual component, used internally by the provider but exported for advanced cases (custom rendering, snapshot stories, etc.).

<Toast
  type="alert"
  title="Project deleted"
  description='Project "Project Name" deleted'
  action={<Button>Undo</Button>}
  onClose={() => {}}
/>

Behavior

  • Auto-dismiss — success 4.5s, info/warning 6.5s, alert 9s. Pass duration={0} to make a toast sticky.
  • Pause on hover/focus — auto-dismiss timer pauses while the toast is hovered or focused, and resumes on leave/blur.
  • Stacking — newest toast appears closest to the screen edge. When limit is exceeded, the oldest toast is dropped.
  • Accessibilityalert toasts use role="alert" / aria-live="assertive"; the rest use role="status" / aria-live="polite".