A comprehensive alert component with full WCAG 2.2 accessibility support, using Ontada Design System tokens.
These alerts can be dismissed by clicking the close button or pressing the Escape key when focused.
Alerts can be displayed without icons for a cleaner, more minimal appearance.
--primary (Info)
--chart-4 (Success)
--accent (Warning)
--destructive-foreground (Error)
--font-family-nunito
--text-base (Title)
--text-sm (Description)
--font-weight-semibold (Title)
--font-weight-regular (Description)
--radius-button (Alert container)
--radius (Dismiss button)
--ring (Focus ring)
--border (Border color)
<!-- Basic info alert -->
<Alert variant="info">
<AlertTitle>Information</AlertTitle>
<AlertDescription>
Your session will expire soon.
</AlertDescription>
</Alert>
<!-- Dismissible warning alert -->
<Alert
variant="warning"
dismissible
onDismiss={() => console.log("Dismissed")}
>
<AlertTitle>Warning</AlertTitle>
<AlertDescription>
Please review before continuing.
</AlertDescription>
</Alert>
<!-- Success alert without icon -->
<Alert variant="success" hideIcon>
<AlertDescription>
Operation completed successfully.
</AlertDescription>
</Alert>