apps/mantine.dev/src/pages/core/alert.mdx
import { AlertDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';
export default Layout(MDX_DATA.Alert);
alertaria-describedby set to body element id, aria-labelledby set to title element id if title is providedcloseButtonLabel prop to make close button accessibleimport { 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 />;
}