MDAlert

Provide contextual feedback messages for typical user actions with the handful of available and flexible alerts/notifications.


The below codes are editable and you can modify them the way you want directly from your browser, please use the green button or the ctrl + s to save the changes.

Demo

// NextJS Material Dashboard 2 components import MDAlert from "/components/MDAlert";
This is an alert!

Props Information

NameTypeDefaultDescription
color'primary''secondary''info''success''warning''error''light''dark'darkChange the MDAlert background color.
dismissibleboolfalseIf true the MDAlert will have a closing button for dismissing it.
children*nodeUse to pass node or content inside the MDAlert, its the only required prop.

With Icon

// NextJS Material Dashboard 2 components import MDAlert from "/components/MDAlert"; // @mui material components import Icon from "@mui/material/Icon";
  This is an alert with icon!

Dismissible

// NextJS Material Dashboard 2 components import MDAlert from "/components/MDAlert";
This is a dismissible alert!
×