Back to components

Alert

zyra-alert

Inline status messages for success, warning, danger, and info states with optional title and dismiss support.

Component preview

Explore the available states and the real library behavior for this component.

zyra-alert Playground

Control every input live and see the result instantly

Controls
title
boolean inputs
variant
Preview
Generated Code
<zyra-alert
  title="Heads up"
>
  Your message here.
</zyra-alert>
All Variants
Dismissible
Without Title

Copy-paste example

Drop this into your Angular standalone component and it works out of the box.

alert.demo.ts
import { Component } from '@angular/core';
import { ZyraAlert } from 'zyra-ng-ui';

@Component({
  selector: 'app-demo',
  standalone: true,
  imports: [ZyraAlert],
  template: `
    <zyra-alert
      variant="success"
      title="Saved"
      [dismissible]="true"
    >
      Your changes have been saved.
    </zyra-alert>
  `,
})
export class DemoComponent {}

Variants

All the visual modes and states available for this component.

success

Confirmation or completed action (green)

info

Informational context or tips (blue)

warning

Cautionary message requiring attention (amber)

danger

Error or destructive state notice (red)

API

All inputs and configuration options for zyra-alert.

PropTypeDefaultDescription
variant'success' | 'info' | 'warning' | 'danger''info'Semantic color and icon
titlestring-Bold heading above the message body
dismissiblebooleanfalseShows a close x button

Accessibility

Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.

  • Renders with role="alert" so the message is announced immediately by screen readers
  • For non-urgent messages, use role="status" via a custom wrapper instead
  • Dismiss button has an accessible aria-label="Dismiss alert"