Skip to content

Alert

Displays a contextual message with status-based styling, an optional collapsible body, and dismiss functionality.

This is an informational alert
<Alert status="info" title="This is an informational alert" />
Info — something to be aware of
Success — operation completed
<div style={{display: 'flex', flexDirection: 'column', gap: '1rem'}}>
<Alert status="info" title="Info — something to be aware of" />
<Alert status="success" title="Success — operation completed" />
<Alert status="warning" title="Warning — proceed with caution" />
<Alert status="error" title="Error — something went wrong" />
</div>
Update available
A new version has been released. Please update at your earliest convenience.
<Alert
status="info"
title="Update available"
description="A new version has been released. Please update at your earliest convenience."
/>
<Alert
status="warning"
title="Before you continue"
description={( <ul style={{margin: 0, paddingInlineStart: '1.25rem'}}> <li>Back up your data before proceeding.</li> <li>Ensure all team members are notified.</li> <li>This action cannot be undone.</li> </ul> )}
/>
Tip of the day
You can dismiss this alert by clicking the X button.
<Alert
status="info"
title="Tip of the day"
description="You can dismiss this alert by clicking the X button."
isDismissable
/>
Deployment summary
<Alert
status="success"
title="Deployment summary"
>
{( <Text> 3 services deployed successfully across 2 regions. No rollback actions were needed. Check the deployment dashboard for detailed metrics. </Text> )}
</Alert>
Deployment summary
3 services deployed successfully across 2 regions. No rollback actions were needed. Check the deployment dashboard for detailed metrics.
<Alert
status="success"
title="Deployment summary"
isDefaultExpanded
>
{( <Text> 3 services deployed successfully across 2 regions. No rollback actions were needed. Check the deployment dashboard for detailed metrics. </Text> )}
</Alert>
New version available
<Alert
status="info"
title="New version available"
endContent={<Button label="Update now" size="sm" variant="ghost" />}
/>
<div style={{display: 'flex', flexDirection: 'column', gap: '1rem'}}>
<Alert
container="card"
status="warning"
title="Card container (default)"
/>
<Alert container="section" status="warning" title="Section container" />
</div>
Feature launched!
Your feature flag is now live in production.
<Alert
status="success"
title="Feature launched!"
description="Your feature flag is now live in production."
icon={<Icon color="accent" icon={Rocket} />}
/>
<Alert
status="warning"
title="System maintenance scheduled"
description="Services will be briefly unavailable during the upgrade window."
isDismissable
isDefaultExpanded
endContent={<Button label="View schedule" size="sm" variant="ghost" />}
>
{( <Text> Maintenance is planned for Saturday 2:00–4:00 AM UTC. Affected services include authentication, billing, and notifications. Please save your work before the maintenance window begins. </Text> )}
</Alert>

Displays a contextual message with status-based styling, an optional collapsible body, and dismiss functionality.

PropTypeDefaultDescription
childrenReactNodeExtra content rendered below the alert header in a collapsible area.
classNamestringAdditional CSS class names applied to the root element.
container"card" | "section"'card'Visual container style.
data-testidstringTest ID applied to the root element.
descriptionReactNodeSupporting description displayed below the title.
endContentReactNodeContent rendered at the end of the header, before collapse and dismiss controls.
iconReactNodeCustom status icon. A default icon is rendered when omitted.
isDefaultExpandedbooleanfalseWhether collapsible children are expanded initially.
isDismissablebooleanfalseWhether the alert can be dismissed.
onDismiss() => voidCalled when the dismiss button is clicked.
padding0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 104Inner padding step.
refRef<HTMLDivElement>Ref forwarded to the root element.
status*"error" | "info" | "success" | "warning"Status controlling role, icon, and color.
styleCSSPropertiesInline styles applied to the root element.
title*ReactNodePrimary alert title.