Attract user attention with important static message



import { Alert } from '@mantine/core';
import { IconInfoCircle } from '@tabler/icons-react';

function Demo() {
  const icon = <IconInfoCircle />;
  return (
    <Alert variant="light" color="blue" title="Alert title" icon={icon}>
      Lorem ipsum dolor sit, amet consectetur adipisicing elit. At officiis, quae tempore necessitatibus placeat saepe.

Styles API

Alert supports Styles API, you can add styles to any inner element of the component withclassNames prop. Follow Styles API documentation to learn more.

Component Styles API

Hover over selectors to highlight corresponding elements

 * Hover over selectors to apply outline styles


  • Root element role set to alert
  • aria-describedby set to body element id, aria-labelledby set to title element id if title is provided
  • Set closeButtonLabel prop to make close button accessible
import { Alert } from '@mantine/core';

function Invalid() {
  // -> not ok
  return <Alert withCloseButton />;

function Valid() {
  // -> ok
  return <Alert withCloseButton closeButtonLabel="Dismiss" />;

function AlsoValid() {
  // -> ok, without close button, closeButtonLabel is not needed
  return <Alert />;