Skip to content

Alert

Displays important messages or notifications to users in a prominent way.

First release: 1.0.0 Latest update: July 1, 2025 Current version: 1.0.0

React Angular Vue Svelte HTML

Import

import { PlusAlert } from '@plusui/react';
import { PlusAlertComponent } from '@plusui/angular';
import { PlusAlert } from '@plusui/vue';
import PlusAlert from '@plusui/svelte';
<script src="https://cdn.jsdelivr.net/npm/@plusui/core"></script>

Package

@plusui/react
@plusui/angular
@plusui/vue
@plusui/svelte
@plusui/core

Docs

Changelog

Alert Changelog

Recent changes and updates for the alert component

v1.0.0

June 20, 2025
Feat

Added Alert component for user feedback

  • 5 status variants: default, success, warning, danger, info
  • Dismissible alerts
  • Custom icons and messages
  • Accessibility with ARIA attributes

The Alert component is used to convey important information to users, such as success messages, warnings, errors, or general information. It typically includes a status icon, a message, an optional description, and a dismiss button.

Alert - anatomy

A basic alert displays a message with a default status icon.

This is an informational alert.
Show code

Use the status prop to indicate the type of message: info (default), success, warning, or danger. This affects the color scheme and the default icon.

Operation successful!
Operation successful!
Operation successful!
Show code

The kind prop controls the visual appearance: filled (default), outlined, or dashed.

Filled (Default)
Filled (Default)
Filled (Default)
Show code

Set the dismissible attribute (or dismissible={true}) to add a close button. The alert fires a plus-dismiss event when closed.

This alert can be closed.
Click the X button to dismiss.
Show code
Show console
Alert - layout spacing Alert - light & dark mode
  • Keyboard Behavior:
    • If the alert is dismissible, the close button is focusable and can be activated using Enter or Space.
  • Screen Reader:
    • The component uses role="alert" to announce its presence and content automatically to screen reader users.
    • aria-live="polite" ensures that updates are announced without interrupting the user, though critical alerts might warrant aria-live="assertive" if implemented via JavaScript.
    • The dismiss button should have an appropriate aria-label (e.g., “Close alert”).
  • Required Developer Actions:
    • Ensure the content provided in the message and description slots is clear and concise.
    • If using custom icons via the prefix slot, ensure they have appropriate alternative text or are marked as decorative (aria-hidden="true") if the status prop already conveys the meaning.
NameTypeDefaultDescriptionRequired
kind`‘filled''outlined''dashed’`'filled'
size`‘sm''md''lg’`'md'
status`‘default''success''warning''danger'
invertbooleanfalseUse inverted color scheme.No
dismissiblebooleantrueShow dismiss button.No
messagestring''Main message content (can also be provided via slot).No
descriptionstring''Additional description (can also be provided via slot).No
statusIconstringundefinedName of the SVG icon to use for status (overrides default).No
dismissIconstringundefinedName of the SVG icon to use for the dismiss button (overrides default).No
fullWidthbooleanfalseMake the alert span the full width of its container.No
NamePayload TypeDescription
plus-dismissCustomEvent<{ status: string }>Fired when the alert is dismissed.
NameDescription
messageThe main message content.
descriptionAdditional descriptive content.
prefixCustom status icon content.
dismissCustom dismiss button content.
PartDescription
baseThe main container element.
status-iconThe status icon container.
contentThe content container.
messageThe message container.
descriptionThe description container.
dismissThe dismiss button container.

Join the Community

Plus UI is built by the community. Join us on our platforms to contribute, get help, and stay up to date.