alert component

Drop-in semantic component. See examples, sizes, variants, and source.

Inline status messages. Apply intent (primary, positive, negative, warning, info) and an optional variant (filled, outline) to alert. Add icon plus an icon name to auto-inject the leading icon, and dismissible for a close button. Auto-dismiss, progress bars, and toast stacking are wired up by alert.js.

Alert System

Basic Alerts - Flexible Content Structure

Simple alert with direct text - no wrapper needed!

Alert with a paragraph element for better semantic HTML.

Warning Title

Description text can follow the title directly - no .content wrapper required.

Using .content wrapper

The .content wrapper is optional but still fully supported for complex layouts.

Alert Sizes - Icons Auto-Scale

Tiny alert - icon auto-sized to w-3.5 h-3.5

Small alert - icon auto-sized to w-4 h-4

Default alert - icon auto-sized to w-5 h-5

Large alert - icon w-5 h-5

Icons scale appropriately with alert size.

Big alert - icon w-6 h-6

Largest alert gets the biggest icon automatically.

Alert Width Variants - Compact for Toasts

Compact Width (Toast Style):

This is a compact alert perfect for toast notifications

Small compact alert

Error toast message

Info notification

Alert Colors - Automatic Icons

Primary - auto uses 'info' icon

Positive - auto uses 'circle-check' icon

Negative - auto uses 'circle-x' icon

Warning - auto uses 'triangle-alert' icon

Info with custom 'bell' icon override

Red

Orange

Yellow

Olive

Green

Teal

Blue

Violet

Purple

Pink

Brown

Grey

Black

Automatic Icon Injection - Simplify Your HTML!

Simple Usage - Just add 'icon' and icon name:

Alert with bell icon - no manual <i> tag needed!
Alert with rocket icon
Alert with heart icon

With Semantic Types - Icons chosen automatically:

Just add 'icon' - uses circle-check automatically
Negative alert - uses circle-x automatically
Warning alert - uses triangle-alert automatically

Override Defaults - Specify custom icon:

Positive with party-popper instead of check
Negative with ban icon instead of x
Warning with siren instead of triangle

Mix with Other Features:

Small + Positive + Icon + Dismissible

Large Outlined Alert

With custom shield-check icon and structured content.

Filled Variant - All Colors

Primary filled alert with solid background

Positive filled alert with solid background

Negative filled alert with solid background

Warning filled alert with solid background

Info filled alert with solid background

Red filled

Orange filled

Yellow filled

Olive filled

Green filled

Teal filled

Blue filled

Violet filled

Purple filled

Pink filled

Brown filled

Grey filled

Black filled

Outline Variant - All Colors

Primary outline alert

Positive outline alert

Negative outline alert

Warning outline alert

Info outline alert

Red outline

Orange outline

Yellow outline

Olive outline

Green outline

Teal outline

Blue outline

Violet outline

Purple outline

Pink outline

Brown outline

Grey outline

Black outline

Alerts with Titles - All Colors

Alerts with Actions

Alert Groups (Stacked)

First notification in the stack

Second notification in the stack

Third notification in the stack

Auto-Dismiss Alerts

Dismissible Alert with Progress

This alert is dismissible and shows progress. Use the button below to add auto-dismiss timer.

Class API Reference

Type Class Usage Notes
Base alert Required base class Always required
content Optional inner wrapper for title + paragraphs Direct text/p children also work
title Heading inside alert Use on h4
actions Trailing action area for buttons / links Inside alert content
alerts Group container — connected stack by default Add separated for gapped layout
Sizes xs Tiny — 12px font, 14px icon Modifier on alert
sm Small — 13px font, 16px icon Modifier on alert
(default) Medium — 14px font, 20px icon No size class needed
xl Large — 15px font, 24px icon Modifier on alert
lg Big — 16px font, 28px icon Modifier on alert
Intents primary Brand blue — auto-icon: info Modifier on alert
positive Green — auto-icon: circle-check Modifier on alert
negative Red — auto-icon: circle-x Modifier on alert
warning Amber — auto-icon: triangle-alert Modifier on alert
info Blue informational — auto-icon: info Modifier on alert
Variants (default) Light tinted background with same-hue border No variant class needed
filled Solid intent-color background with white text Modifier on alert (alias: solid)
outline Transparent background, intent-color border Modifier on alert
Layout compact Caps width at 320px — toast-style Modifier on alert
separated Gap between alerts in a stack Modifier on alerts
States & Behaviour icon [name] Auto-inject leading icon — e.g. icon bell Mounted by alert.js
dismissible Adds top-right close button Modifier on alert
progress Animated progress bar across the bottom Pair with auto-dismiss="N"
auto-dismiss="N" Auto-close after N seconds HTML attribute, not a class
Toast #stack-toasts Fixed-position container — alerts inside become toasts Add a position modifier (see next row)
top-right, bottom-center, … Toast stack position 9 corners + topstretch / bottomstretch