Components
Alert

Alert

Import

import { VKAlert } from "@vivakits/react-components";

Severity

Alerts are available in four severity levels: info, success, warning, and error. The severity level can be set using the severity prop.

ℹ️

This is an info alert — check it out!

This is a success alert — check it out!

⚠️

This is a warning alert — check it out!

🚫

This is an error alert — check it out!

Variants

Alerts are available in two variants: filled and outlined. The variant can be set using the variant prop.

ℹ️

This is a filled alert!

This is an outlined alert!

Actions

You can add an action to the Alert using the action prop. If you provide an onClose callback to the Alert without setting the action prop, the component will display a close icon (✕) by default.

⚠️

This Alert displays the default close icon.

ℹ️

This is an alert with a button!

Icon

You can remove the icon from the Alert using the icon prop or add a custom icon.

ℹ️

This is the default alert!

This alert has no icon!

✔️

This is an alert with a custom icon!

Title

You can add a title to the Alert using the title prop.

ℹ️

Title

This is an alert with a title!

Custom Class

You can customize the Alert using the className prop.

🌿

This is a customised alert!

API Reference

AttributeTypeDescriptionDefault
severitysuccesswarninginfoerrorDefines the style and icon used to indicate the alert's level of importance.-
variantsfilledoutlinedSpecifies the visual appearance of the alert.filled
actionfunctionOptional action to display on the alert, such as a dismiss or undo button.-
iconboolean | ReactNodeAllows customization of the icon displayed in the alert. Set to false to hide the icon.true
titlestringThe text to display as the alert message's title.-
classNamestringCustom class for the input mask field-