DocsComponentsAlert

Alert

Alerts are temporary notifications that provide concise feedback about an action or event.

Usage

Colors

Variants

Radius

Custom Icon

By default, Alert displays an appropriate icon based on the color classes. You can override this by providing a custom icon inside the icon-wrapper with the class alert-icon.

Without Icon

You can hide the icon by using the data-hide-icon attribute.

Without Icon Wrapper

You can hide the icon wrapper by using the data-hide-icon-wrapper attribute.

With Action

Controlled Visibility

Slots

Alert has the following slots:

  • alert: The main alert container element.
  • title: The title element.
  • description: The description element.
  • main-wrapper: The wrapper for the title and description content.
  • closebutton: The close button element.
  • icon-wrapper: The wrapper for the alert icon.
  • alert-icon: The alert icon element.

Custom styles

You can customize the Alert by passing custom Tailwind CSS classes to the component slots.

Data Attributes

Alert has the following attributes on the base element:

  • data-hide-icon: Whether the icon is hidden.
  • data-hide-icon-wrapper: Whether the icon wrapper is hidden.

Alert Properties

PropertyTypeDescriptionDefault
colordefault | primary | secondary | success | warning | dangerThe alert color theme.default
radiusnone | sm | md | lg | fullThe alert border radius.md
variantsolid | bordered | flat | fadedThe alert variant.solid
data-hide-icon"true" | "false"Whether the icon is hidden.false
data-hide-icon-wrapper"true" | "false"Whether the icon wrapper is hidden.false