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

@aicadev/toast-message

v1.0.3

Published

πŸ”” Lightweight and framework-agnostic Web Component for toast notifications

Readme

@aicadev/toast-message

πŸ”” Lightweight and framework-agnostic Web Component for toast notifications.

This package provides a simple, customizable <toast-message> Web Component that works with any frontend stack (Vanilla JS, React, Vue, Astro, etc.).

Demo: https://aitorcachero.github.io/aicadev-toast-message/


✨ Features

  • βœ… No dependencies
  • βœ… Highly customizable with multiple attributes
  • βœ… Works with any framework (or none)
  • βœ… Lightweight and fast
  • βœ… Easy to style or extend
  • βœ… Built with Web Standards
  • βœ… HTML support in messages
  • βœ… Flexible positioning
  • βœ… Accessible
  • βœ… Smooth animations

πŸš€ Installation

npm install @aicadev/toast-message

πŸ§ͺ Basic Usage

Import the component in your project:

import '@aicadev/toast-message';

Then use it like this:

// Create and show a toast
function showToast(
  message,
  type = 'info',
  duration = 3000,
  position = 'top-right',
  closeable = false
) {
  const toast = document.createElement('toast-message');
  toast.innerHTML = message;
  toast.setAttribute('type', type);
  toast.setAttribute('duration', duration);
  toast.setAttribute('position', position);
  if (closeable) {
    toast.setAttribute('closeable', '');
  }
  document.body.appendChild(toast);
}

// Usage examples
showToast('Operation successful!', 'success');
showToast(
  '<strong>Error:</strong> Something went wrong',
  'error',
  5000,
  'bottom-center',
  true
);

πŸ›  Attributes

| Attribute | Type | Default | Description | | ----------- | ------- | ----------- | -------------------------------------------------------------- | | type | string | info | Defines the toast style: info, success, error, warning | | duration | number | 3000 | Time in milliseconds before toast disappears | | position | string | top-right | Position of the toast on the screen | | closeable | boolean | false | Shows a button to manually close the toast |

Available Positions

  • top-right
  • top-left
  • top-center
  • bottom-right
  • bottom-left
  • bottom-center

πŸ“¦ Build & Development (for contributors)

git clone https://github.com/your-username/toast-message.git
cd toast-message
npm install
npm run dev        # Start dev server
npm run build      # Output build to /dist

Built using Vite. Output is bundled as an ES Module ready for direct use.


πŸ“€ Publishing

If you're the package maintainer:

npm login
npm run build
npm publish --access public

πŸ”§ Example in React (or other frameworks)

import '@aicadev/toast-message';

function App() {
  const handleClick = () => {
    const toast = document.createElement('toast-message');
    toast.innerHTML = '<strong>React</strong> triggered this!';
    toast.setAttribute('type', 'success');
    toast.setAttribute('duration', '4000');
    toast.setAttribute('position', 'top-center');
    toast.setAttribute('closeable', '');
    document.body.appendChild(toast);
  };

  return <button onClick={handleClick}>Show Toast</button>;
}

🎨 ## Customization

The component is encapsulated with Shadow DOM, but you can fork or extend the component easily to change:

  • Animations
  • Colors
  • Icons
  • Styles
  • Positions
  • Behavior

πŸͺͺ License

MIT License β€” Copyright Β© 2025 @aicadev


πŸ’¬ Support / Feedback

If you find any bugs or want improvements, feel free to open an issue or contribute via pull request.