Alert

Attract user attention with important static message
Import

Usage

Color
Radius
xs
sm
md
lg
xl
Variant
import { Alert } from '@mantine/core';
import { AlertCircle } from 'tabler-icons-react';
function Demo() {
return (
<Alert icon={<AlertCircle size={16} />} title="Bummer!" color="red">
Something terrible happened! You made a mistake and there is no going back, your data was lost forever!
</Alert>
);
}

Accessibility

  • Root element role set to alert
  • Set closeButtonLabel prop to make close button visible for screen readers
<Alert withCloseButton /> // -> not ok
<Alert withCloseButton closeButtonLabel="Close alert" /> // -> ok
<Alert /> // -> ok, without close button, closeButtonLabel is not needed