Alert

An inline alert component for displaying contextual feedback messages. Supports four severity variants with automatic icon selection, optional title, dismiss button, and custom action elements.

Import

import { Alert } from '@wavebooking/aqua-fusion';

Preview

Loading preview...

Usage

<Alert variant="info" title="Information">
  This is an informational message.
</Alert>

Severity variants

<Alert variant="success" title="Success">Operation completed.</Alert>
<Alert variant="warning" title="Warning">Please review your input.</Alert>
<Alert variant="error" title="Error">Something went wrong.</Alert>

Dismissible with action

<Alert
  variant="warning"
  title="Subscription expiring"
  dismissible
  onDismiss={() => console.log('dismissed')}
  action={<Button size="sm" variant="outline">Renew</Button>}
>
  Your subscription expires in 3 days.
</Alert>

Props

PropTypeDefaultDescription
variant'default' | 'info' | 'success' | 'warning' | 'error''info'Severity variant controlling color scheme and default icon.
titlestring-Bold title displayed above the description.
childrenReactNode-Description content rendered below the title.
dismissiblebooleanfalseWhether to show a close button in the top-right corner.
onDismiss() => void-Callback when the dismiss button is clicked.
iconReactNode-Custom icon element replacing the default variant icon.
showIconbooleantrueWhether to display the leading icon.
actionReactNode-Action element (button, link) rendered below the description.
classNamestring-Additional CSS class for the alert container.