Alerts

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

On this page

Examples

Alerts are available for any length of text, as well as an optional close button. For proper styling, use one of the eight required contextual classes (e.g., theme="success").

vue

Link color

Use the AlertLink compoennt utility class to quickly provide matching colored links within any alert.

vue

Additional content

Alerts can also contain additional HTML elements like headings, paragraphs and dividers.

vue

Icons

vue

Need more than one icon for your alerts? Consider using more NuxtIcon and making a SVG sprite like so to easily reference the same icons repeatedly.

vue

Dismissing

Using the CloseButton components, it's possible to dismiss any alert inline. Here's how:

You can see this in action with a live demo:

vue

Triggers

Dismissal can be achieved with the dismiss attribute on a button within the alert as demonstrated below:

vue

or on a button outside the alert using the target as demonstrated below:

vue

Methods

MethodDescription
toggle Manual switching
show Manually show
hide Manually hide
On this page