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-notification

v0.103.0

Published

A cross-platform React notification component for displaying alerts, success messages, warnings, and errors. Supports both toast and inline display modes.

Readme

Notification

A cross-platform React notification component for displaying alerts, success messages, warnings, and errors. Supports both toast and inline display modes.

Installation

npm install @xsolla/xui-notification
# or
yarn add @xsolla/xui-notification

Demo

Basic Notification

import * as React from 'react';
import { Notification } from '@xsolla/xui-notification';

export default function BasicNotification() {
  return (
    <Notification
      title="Success"
      message="Your changes have been saved."
      tone="success"
    />
  );
}

Notification Tones

import * as React from 'react';
import { Notification } from '@xsolla/xui-notification';

export default function NotificationTones() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
      <Notification tone="neutral" title="Info" message="This is an informational message." />
      <Notification tone="success" title="Success" message="Operation completed successfully." />
      <Notification tone="warning" title="Warning" message="Please review before proceeding." />
      <Notification tone="alert" title="Error" message="Something went wrong." />
    </div>
  );
}

Notification Types (Toast vs Inline)

import * as React from 'react';
import { Notification } from '@xsolla/xui-notification';

export default function NotificationTypes() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
      <Notification
        type="toast"
        tone="success"
        title="Toast Notification"
        message="This is a toast-style notification."
      />
      <Notification
        type="inline"
        tone="warning"
        title="Inline Notification"
        message="This is an inline-style notification."
      />
    </div>
  );
}

Dismissible Notification

import * as React from 'react';
import { Notification } from '@xsolla/xui-notification';

export default function DismissibleNotification() {
  const [visible, setVisible] = React.useState(true);

  if (!visible) return null;

  return (
    <Notification
      title="Notification"
      message="Click the X to dismiss this notification."
      onClose={() => setVisible(false)}
    />
  );
}

Notification with Action

import * as React from 'react';
import { Notification } from '@xsolla/xui-notification';

export default function ActionNotification() {
  return (
    <Notification
      tone="alert"
      title="Session Expiring"
      message="Your session will expire in 5 minutes."
      actionLabel="Extend Session"
      onAction={() => console.log('Session extended')}
      onClose={() => console.log('Dismissed')}
    />
  );
}

Hide Close Button

import * as React from 'react';
import { Notification } from '@xsolla/xui-notification';

export default function PersistentNotification() {
  return (
    <Notification
      tone="warning"
      title="Important"
      message="This notification cannot be dismissed."
      showClose={false}
    />
  );
}

API Reference

Notification

Notification Props:

| Prop | Type | Default | Description | | :--- | :--- | :------ | :---------- | | tone | "neutral" \| "success" \| "warning" \| "alert" | "neutral" | Semantic color tone of the notification. | | type | "toast" \| "inline" | "toast" | Display mode - toast for floating notifications, inline for embedded. | | title | string | - | Notification title text. | | message | string | - | Notification message/description text. | | actionLabel | string | - | Text for the action button (optional). | | onAction | () => void | - | Callback when action button is clicked. | | onClose | () => void | - | Callback when close button is clicked. | | showClose | boolean | true | Whether to show the close button. |

Tone Values

| Tone | Use Case | | :--- | :------- | | neutral | General information, default state | | success | Positive outcomes, confirmations | | warning | Caution, requires attention | | alert | Errors, critical issues |

Type Values

| Type | Description | | :--- | :---------- | | toast | Floating notification style, typically used for temporary messages | | inline | Embedded notification style, integrated into the page layout |

Theming

// Tone-specific colors accessed via theme
theme.colors.background.neutral.secondary  // Neutral background
theme.colors.background.success.secondary  // Success background
theme.colors.background.warning.secondary  // Warning background
theme.colors.background.alert.secondary    // Alert/error background

theme.colors.content.neutral.primary       // Neutral icon color
theme.colors.content.success.primary       // Success icon color
theme.colors.content.warning.primary       // Warning icon color
theme.colors.content.alert.primary         // Alert icon color

Accessibility

  • Uses semantic color tones for visual distinction
  • Close button is keyboard accessible
  • Icons are decorative and hidden from screen readers
  • Action buttons are focusable and clickable