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

@manufosela/slide-notification

v2.1.0

Published

Slide-in notification web component from the right edge

Readme

@manufosela/slide-notification

Slide-in notification web component from the right edge. Built with Lit.

Installation

npm install @manufosela/slide-notification

Usage

import { showSlideNotification } from '@manufosela/slide-notification';

// Simple notification
showSlideNotification({
  message: 'Hello, world!'
});

// With type and title
showSlideNotification({
  type: 'success',
  title: 'Success!',
  message: 'Your changes have been saved.'
});

Features

  • Slides in from the right edge
  • Four notification types (info, success, warning, error)
  • Auto-hide with configurable duration
  • HTML message support
  • Custom background colors
  • CSS custom properties for theming

Attributes

| Attribute | Type | Default | Description | | ------------------ | ------- | ------- | ------------------------------ | | title | String | '' | Notification title | | message | String | '' | Message (supports HTML) | | type | String | info | Type: info, success, warning, error | | timetohide | Number | 3000 | Auto-hide delay in ms (0 = never) | | background-color | String | '' | Custom background color | | persistent | Boolean | false | Stay visible until clicked |

Methods

| Method | Description | | -------- | ---------------------------------------- | | show() | Show the notification | | hide() | Hide the notification |

Events

| Event | Description | | ---------------------------- | ------------------------------ | | slide-notification-shown | Fired when notification appears | | slide-notification-hidden | Fired when notification hides |

Notification Types

// Info (default) - Blue
showSlideNotification({ type: 'info', message: 'Info message' });

// Success - Green/Blue
showSlideNotification({ type: 'success', message: 'Success!' });

// Warning - Yellow (dark text)
showSlideNotification({ type: 'warning', message: 'Warning!' });

// Error - Red
showSlideNotification({ type: 'error', message: 'Error occurred' });

Custom Duration

// Quick notification (1 second)
showSlideNotification({
  message: 'Quick!',
  timetohide: 1000
});

// Persistent (click to close)
showSlideNotification({
  message: 'Click me to close',
  persistent: true
});

Declarative Usage

For manual control, use the element in HTML:

<slide-notification id="myNotification"
  title="Hello"
  message="Click buttons to control"
  persistent>
</slide-notification>

<button onclick="myNotification.show()">Show</button>
<button onclick="myNotification.hide()">Hide</button>

Custom Colors

showSlideNotification({
  message: 'Purple notification',
  backgroundColor: '#8b5cf6'
});

CSS Custom Properties

| Property | Default | Description | | --------------------------------- | ------------------------------ | ------------------ | | --slide-notification-width | 300px | Notification width | | --slide-notification-bg | #17a2b8 | Background color | | --slide-notification-color | white | Text color | | --slide-notification-radius | 8px | Border radius | | --slide-notification-padding | 1.5rem | Padding | | --slide-notification-shadow | 0 2px 8px rgba(0,0,0,0.2) | Box shadow | | --slide-notification-bottom | 20px | Bottom position | | --slide-notification-z-index | 10000 | Z-index | | --slide-notification-min-height | 80px | Minimum height |

Accessibility

  • Uses role="alert" with aria-live="assertive" for error/warning types
  • Uses role="status" with aria-live="polite" for info/success types
  • Icons are hidden from screen readers (aria-hidden="true")
  • Click-to-close for persistent notifications is accessible
  • Respects prefers-reduced-motion by disabling slide animation

slide-notification vs toast-notification

This library includes two notification components. Choose based on your needs:

| Feature | slide-notification | toast-notification | |---------|--------------------|-------------------| | Animation | Slides in from right edge | Appears in corner | | Position | Right side only | 6 positions (corners + centers) | | Stacking | One at a time | Multiple stack vertically | | Progress bar | No | Yes | | Close button | No (click anywhere) | Yes | | Persistent mode | persistent attribute | duration="0" | | Best for | Single important messages | Multiple sequential notifications |

Use slide-notification when:

  • You want a prominent single notification
  • You prefer slide-in animation
  • You want click-anywhere-to-close behavior

Use toast-notification when:

  • You need to show multiple notifications
  • You want position flexibility (6 options)
  • You need a progress bar indicator

License

MIT