Alert

The Alert component is used to display important messages to the user with support for different variants and actions.

Usage & Examples

Default

Notification saved
This alert can be dismissed.
default.tsx
<Alert title="Notification saved" state="info" dismissLabel="Close notification" icon={<FaInfoCircle />} dismissible>
  This alert can be dismissed.
</Alert>

Props API

24 props
Columns
Alert props API
Default
Description
actionsReactNodeNopropsAction content rendered by the component.
actionsClassNamestringNopropsAdditional CSS class names for the actions section.
childrenReactNodeNopropsContent rendered inside the component.
classNamestringNostylingAdditional CSS class names for the component root.
contentClassNamestringNopropsAdditional CSS class names for the content section.
data-testidstringNotestingTest id used to identify the component in tests.
dismissButtonClassNamestringNopropsAdditional CSS class names for the dismiss button section.
dismissiblebooleanNopropsfalseDismissible.
dismissLabelstringNoprops"Dismiss alert"Dismiss Label.
glassbooleanNopropsconfigured default glass setting (fallback: false)Glass.
iconReactNodeNopropsIcon rendered by the component.
iconClassNamestringNopropsAdditional CSS class names for the icon section.