Alert Banner
1.17.0A 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.
<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.
<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.
<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.
<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.
@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.
<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:
string<div q-alert-banner-description>...</div>
booleantrue, renders a close button that calls closed when clicked.<button q-alert-banner-close-button>...</button>
string<div q-alert-banner-heading>...</div>
Composite API
q-alert-banner-root
string'ltr' | 'rtl'
| 'info'
| 'success'
| 'warning'
| 'danger'
| 'neutral'
| 'strong'
| 'subtle'
voidq-alert-banner-icon
LucideIconDataclass'qui-alert-banner__icon'data-alert-banner-part'status-icon'q-alert-banner-heading
class'qui-alert-banner__heading'data-alert-banner-part'heading'q-alert-banner-description
class'qui-alert-banner__description'data-alert-banner-part'description'q-alert-banner-close-button
class'qui-alert-banner__close-button'data-alert-banner-part'close-button'q-alert-banner-button
booleantrue, pointer/focus
events are blocked, and the component is visually dimmed.| LucideIconData
| string
<svg q-end-icon icon="..."></svg>
| LucideIconData
| string
<svg q-start-icon icon="..."></svg>
class'qui-alert-banner__action'data-alert-banner-part'action'data-button-part'root'data-density| 'default'
| 'compact'
data-disableddata-kind'text'data-size| 'sm'
| 'md'
| 'lg'
data-variant| 'fill'
| 'ghost'
| 'outline'
q-alert-banner-action
class'qui-alert-banner__action'data-alert-banner-part'action'