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

@bloc-ui/toast

v0.0.4

Published

> **Latest:** v0.0.4

Readme

@bloc-ui/toast

Latest: v0.0.4

Toast notification service for Angular — part of the Bloc UI component library. Show info, success, warning, and error notifications programmatically with auto-dismiss and close button support.

Live Documentation & Demos

Tip: You can also install @bloc-ui/kit to get this package along with every other Bloc UI component in a single import.


Installation

npm install @bloc-ui/toast

Peer dependencies: @angular/common and @angular/core ≥ 21.


Usage

The toast system is service-driven. Show notifications programmatically via BlocToastService.

import {
    BlocToastService,
    BlocToastConfig,
    BlocToastType,
    BlocToastPosition,
    BlocToastComponent,
    BlocToastContainerComponent,
    BlocToastModule,
} from '@bloc-ui/toast';

BlocToastService

private readonly toast = inject(BlocToastService);

// Shorthand methods
toast.info('Something happened');
toast.success('Saved!', 'Success');
toast.warning('Check your input', 'Warning');
toast.error('Failed to save', 'Error');

// Full configuration
toast.show({
  message: 'Custom toast',
  title: 'Note',
  type: 'info',
  duration: 5000,
  dismissible: true,
  position: 'top-right',
});

// Dismiss
toast.dismiss(id);
toast.dismissAll();

BlocToastConfig

| Property | Type | Default | Description | | ------------- | ------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------- | | message | string | — | Toast message text (required) | | title | string | '' | Optional title | | type | BlocToastType | 'info' | 'info' \| 'success' \| 'warning' \| 'error' | | duration | number | 4000 | Auto-dismiss ms (0 = no auto-dismiss) | | dismissible | boolean | true | Show close button | | position | 'top-right' \| 'top-left' \| 'bottom-right' \| 'bottom-left' \| 'top-center' \| 'bottom-center' | 'top-right' | Screen position of the toast container |


CSS tokens

| Token | Fallback | Description | | ---------------------------- | ----------------------------- | -------------------------- | | --bloc-toast-padding | 12px 14px | Toast padding | | --bloc-toast-radius | 8px | Toast border radius | | --bloc-toast-bg | #ffffff | Toast background | | --bloc-toast-border | var(--bloc-border, #d1d5db) | Toast border colour | | --bloc-toast-shadow | 0 4px 12px rgba(0,0,0,0.1) | Toast shadow | | --bloc-toast-info-color | #6b7280 | Info icon colour | | --bloc-toast-success-color | #16a34a | Success icon colour | | --bloc-toast-warning-color | #d97706 | Warning icon colour | | --bloc-toast-error-color | #dc2626 | Error icon colour | | --bloc-toast-title-color | #374151 | Title text colour | | --bloc-toast-message-color | #6b7280 | Message text colour | | --bloc-toast-close-color | #9ca3af | Close button colour | | --bloc-toast-z-index | 9999 | Container z-index | | --bloc-toast-offset | 16px | Container top/right offset | | --bloc-toast-gap | 8px | Gap between toasts | | --bloc-toast-max-width | 380px | Container max width |


Accessibility

  • Each toast uses role="alert" and aria-live="polite" for screen reader announcements.
  • Dismiss button is available when dismissible is true.
  • Toasts can be programmatically dismissed via dismiss(id) or dismissAll().

Theming

All visual tokens (--bloc-primary, --bloc-surface, colour scales, dark-mode) are provided by the optional @bloc-ui/theme package. The toast works without it — neutral fallbacks are applied automatically.


License

MIT