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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ang-alert-bar

v3.1.0

Published

Angular Message component with different severity types and predefined styles

Downloads

28

Readme

Angular Alert Bar

  • Display contextual messages (success, info, warning, error) with clean, accessible styles that match modern web apps.
  • Just plug-and-play with simple Angular inputs—customize appearance, overflow, and alert variants (filled, outlined, text) to suit your needs.
  • Includes SVG icons, full ARIA support, theming options, and responsive design for consistent user feedback across all devices.
  • Works seamlessly in any Angular project (standalone or monorepo) with minimal dependencies.

Examples/Demo

Live Demo Example

Severities

ang-alert-bar

Paginated

ang-alert-bar

Filled

ang-alert-bar

Outlined

ang-alert-bar

Custom Template

ang-alert-bar

Installation

npm i ang-alert-bar

API

import { AngAlertBarComponent } from 'ang-alert-bar' selector: alert-bar

@Inputs()

| Input | Type | Required | Description | | -------------------- | -------------------- | ------------------------ | -------------------------------------------- | | messages | AlertMessage[] | YES | array of AlertMessage | | paginated | boolean | Optional, default: false | enable pagination | | truncateTextOverflow | boolean | Optional, default: true | message will be truncated to fit in one line | | variant | AlertMessageVariants | Optional, default: Text | variant style - Text, Filled or Outlined | | severityIcon | boolean | Optional, default: true | show severity icon | | closeIcon | boolean | Optional, default: true | show close icon |

@Outputs()

| Input | Type | Description | | ---------- | ------------ | -------------- | | closeEvent | AlertMessage | event on close |

Types

  1. Model - AlertMessage
alertType: AlertMessageTypes;
alertMessage: string | TemplateRef<any>;
  1. Enum - AlertMessageVariants
  Text,
  Outlined,
  Filled,
  1. Enum - AlertMessageTypes
  Success,
  Info,
  Warning,
  Error,

Usage

Use of component via selector 'ang-alert-bar'.

@Component({
  imports: [AngAlertBarComponent],
  selector: "app-root",
  template: `
    <alert-bar
      [messages]="messages1"
      [paginated]="paginated"
      [truncateTextOverflow]="truncateTextOverflow"
      [variant]="variant"
      [closeIcon]="closeIcon"
      [severityIcon]="severityIcon"
      (closeEvent)="onCloseEvent($event)"
    />

    <h3>Custom Template Example</h3>

    <alert-bar [messages]="message2" severityIcon closeIcon />

    <ng-template #customTpl let-data>
      <div class="content">
        <div class="title">Merged pull request</div>
        <div class="description">
          Pull request #41 merged after a successful build
        </div>
        <div class="actions">
          <a>View commit</a>
          <a>Dismiss</a>
        </div>
      </div>
    </ng-template>
  `,
  styleUrl: "app.component.scss",
})
export class AppComponent implements OnInit {
  customTpl = viewChild.required<TemplateRef<any>>("customTpl");

  messages1: AlertMessage[] = [
    {
      alertType: AlertMessageTypes.Info,
      alertMessage: "Please read the comments carefully",
    },
    {
      alertType: AlertMessageTypes.Success,
      alertMessage: "Your message has been sent successfully",
    },
    {
      alertType: AlertMessageTypes.Warning,
      alertMessage: "There was a problem with your network connection",
    },
    {
      alertType: AlertMessageTypes.Error,
      alertMessage: "A problem occurred while submitting your data",
    },
  ];

  message2: AlertMessage[] = [];

  AlertMessageVariants = AlertMessageVariants;
  truncateTextOverflow = true;
  paginated = false;
  severityIcon = true;
  closeIcon = true;
  variant: AlertMessageVariants = AlertMessageVariants.Text;

  ngOnInit() {
    this.message2 = [
      {
        alertType: AlertMessageTypes.Success,
        alertMessage: this.customTpl(),
      },
    ];
  }

  onCloseEvent(message: AlertMessage) {
    this.messages1 = this.messages1.filter((x) => x != message);
  }
}

License

MIT © lahsiv

Thanks for Installing

Contact me for any suggestion/issues -> [email protected]