BrowseAlert

Feedback

Glass Alert

An inline message in four tones that can fold itself away when dismissed.

Preview

Heads up

Your trial ends in three days.

Saved

Every change is in.

Installation

Install the package once, then import the parts you use into a standalone component.

Install

npm install ngx-vitreo @angular/cdk @floating-ui/dom
Import

import { GlassAlert } from 'ngx-vitreo';

@Component({
  imports: [GlassAlert],
  // ...
})

Usage

Usage

<glass-alert title="Heads up">Your trial ends in three days.</glass-alert>
<glass-alert tone="success" title="Saved">Every change is in.</glass-alert>

@if (shown()) {
  <glass-alert dismissible title="New version" (dismiss)="shown.set(false)">
    Reload to get it.
  </glass-alert>
}

<glass-alert title="Custom icon">
  <svg glassAlertIcon viewBox="0 0 20 20">…</svg>
  The tone's icon is replaced.
</glass-alert>

API reference

GlassAlert

glass-alert

InputTypeDefaultDescription
tone'info' | 'success' | 'warning' | 'danger''info'Colour, icon and announcement role.
titlestringNoneA bold line above the message.
iconbooleantruefalse shows no icon. Project an element marked glassAlertIcon to replace the tone's icon.
dismissiblebooleanfalseShows a close button that folds the alert away.
(dismiss)voidNoneEmits once the alert has folded away; remove the alert here and track each alert by a stable key.
dismissLabelstring'Dismiss'Accessible name of the close button.
rolestring 'alert' for warning and danger, else 'status' Overrides the announcement role.