Alert Banner

1.17.0

A prominent notification component for displaying important information or system status messages. Alert banners span the full width of their container and use distinctive colors to indicate message severity.

import {AlertBannerModule} from "@qualcomm-ui/angular/alert-banner"

Examples

Simple

Use the simple API to create a banner using minimal markup.

Heading
Description
<div
  description="Description"
  dismissable
  heading="Heading"
  q-alert-banner
  (closed)="onClose()"
>
  <button q-alert-banner-button>Action</button>
</div>

Composite

The composite API provides individual sub-components for custom layouts or when you need to render custom content within each slot.

Heading
Description
<div q-alert-banner-root (closed)="onClose()">
  <span q-alert-banner-icon></span>
  <div q-alert-banner-heading>Heading</div>
  <div q-alert-banner-description>Description</div>
  <button q-alert-banner-button>Action</button>
  <button q-alert-banner-close-button></button>
</div>

Emphasis

The emphasis prop controls the banner's color scheme. The default is info. Each emphasis also determines the default icon.

info
success
warning
neutral
<div emphasis="info" heading="info" q-alert-banner>
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="success" heading="success" q-alert-banner>
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="warning" heading="warning" q-alert-banner>
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="danger" heading="danger" q-alert-banner>
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="neutral" heading="neutral" q-alert-banner>
  <button q-alert-banner-button>Action</button>
</div>

Variant

The variant prop controls visual prominence. The default strong variant uses solid backgrounds for high visibility. The subtle variant uses muted backgrounds with borders.

info
success
warning
neutral
<div emphasis="info" heading="info" q-alert-banner variant="subtle">
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="success" heading="success" q-alert-banner variant="subtle">
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="warning" heading="warning" q-alert-banner variant="subtle">
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="danger" heading="danger" q-alert-banner variant="subtle">
  <button q-alert-banner-button>Action</button>
</div>
<div emphasis="neutral" heading="neutral" q-alert-banner variant="subtle">
  <button q-alert-banner-button>Action</button>
</div>

Dismissable

The banner is a controlled component. Set dismissable to render a close button, then handle visibility state via the closed output. With the composite API, use q-alert-banner-close-button.

Simple API
Composite API
@if (simpleVisible) {
  <div
    closeButtonAriaLabel="Close this banner"
    dismissable
    heading="Simple API"
    q-alert-banner
    (closed)="simpleVisible = false"
  ></div>
}

@if (compositeVisible) {
  <div
    closeButtonAriaLabel="Close this banner"
    q-alert-banner-root
    variant="subtle"
    (closed)="compositeVisible = false"
  >
    <span q-alert-banner-icon></span>
    <div q-alert-banner-heading>Composite API</div>
    <button q-alert-banner-close-button></button>
  </div>
}

Action

The q-alert-banner-button was added in v2.6.0 and should be used instead of the q-alert-banner-action directive.

Strong
Use white-persistent emphasis for strong variant
Subtle
Use neutral emphasis for subtle variant
<div
  description="Use white-persistent emphasis for strong variant"
  heading="Strong"
  q-alert-banner
  variant="strong"
>
  <button q-alert-banner-button>Take action</button>
</div>

<div
  description="Use neutral emphasis for subtle variant"
  heading="Subtle"
  q-alert-banner
  variant="subtle"
>
  <button q-alert-banner-button>Take action</button>
</div>

Explorer

Component Anatomy

Hover to highlight, click to view API

API

q-alert-banner

The q-alert-banner directive extends the q-alert-banner-root directive with the following properties:

PropTypeDefault
Optional description text for the banner.
string
When true, renders a close button that calls closed when clicked.
boolean
false
Optional heading text for the banner.
string
Type
string
Description
Optional description text for the banner.
Type
boolean
Description
When true, renders a close button that calls closed when clicked.
Type
string
Description
Optional heading text for the banner.

Composite API

q-alert-banner-root

PropTypeDefault
Accessible label for the close button.
string
'Close'
The document's text/writing direction.
'ltr' | 'rtl'
"ltr"
Governs the color of the banner and its icon.
| 'info'
| 'success'
| 'warning'
| 'danger'
| 'neutral'
'info'
The visual style of the banner.
| 'strong'
| 'subtle'
'strong'
Event emitted when the close button is clicked.
void
Type
string
Description
Accessible label for the close button.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
| 'info'
| 'success'
| 'warning'
| 'danger'
| 'neutral'
Description
Governs the color of the banner and its icon.
Type
| 'strong'
| 'subtle'
Description
The visual style of the banner.
Type
void
Description
Event emitted when the close button is clicked.

q-alert-banner-icon

PropType
Override the icon displayed in the banner. When this prop is omitted, the icon is determined by the emphasis prop.
LucideIconData
Type
LucideIconData
Description
Override the icon displayed in the banner. When this prop is omitted, the icon is determined by the emphasis prop.

q-alert-banner-heading

q-alert-banner-description

q-alert-banner-close-button

q-alert-banner-button

PropTypeDefault
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
boolean
false
lucide-angular icon, positioned after the label.
| LucideIconData
| string
lucide-angular icon, positioned before the label.
| LucideIconData
| string
Type
boolean
Description
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
Type
| LucideIconData
| string
Description
lucide-angular icon, positioned after the label.
Type
| LucideIconData
| string
Description
lucide-angular icon, positioned before the label.

q-alert-banner-action

Last updated on by Ryan Bower