Equality
Equality

Alert

Alert with sizes and variants

Overview


The Alert component displays important messages to users, usually as a result of an action they took. Use alerts to communicate status, warnings, errors, or success states.

  • Default: General information.
  • Success: Positive outcomes or confirmations.
  • Warning: Cautionary information that needs attention.
  • Danger: Critical errors or destructive actions.

Usage


Import the component:

import { Alert, AlertTitle, AlertDescription } from "@eqtylab/equality";

Basic usage with title and description:

<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>This is an important message.</AlertDescription>
</Alert>

Variants


Usage

<Alert variant="success">
  <AlertTitle>Success</AlertTitle>
  <AlertDescription>Your changes have been saved successfully.</AlertDescription>
</Alert>

<Alert variant="warning">
  <AlertTitle>Warning</AlertTitle>
  <AlertDescription>Please review your input before continuing.</AlertDescription>
</Alert>

<Alert variant="danger">
  <AlertTitle>Danger</AlertTitle>
  <AlertDescription>A serious error occurred.</AlertDescription>
</Alert>

Slots


NameDescription
AlertTitleRenders the alert heading as an <h5> element.
AlertDescriptionRenders the alert body content as a <div> element.

Props


Alert

NameDescriptionTypeDefaultRequired
variantThe visual style of the alertdefault, success, warning, dangerdefault

AlertTitle

Accepts all standard HTML heading attributes.

AlertDescription

Accepts all standard HTML paragraph attributes.