Tailwind CSS Alert - Props

The following props are available for button component. These are the custom props that come with we've added for the alert component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
variantVariantChange alert variantfilled
colorColorChange alert colorblue
dismissibleDismissibleMakes alert dismissibleundefined
animateAnimateChange alert animationundefined
showbooleanChange alert visibilitytrue
iconnodeAdd icon at the beginning of alertundefined
classNamestringAdd custom className for alert''
childrennodeAdd content for alertNo default value it's a required prop.


For TypeScript Only

import type { AlertProps } from "@material-tailwind/react";

Types - Variant

type variant = "filled" | "gradient";

Types - Color

type color =
  | "blue-gray"
  | "gray"
  | "brown"
  | "deep-orange"
  | "orange"
  | "amber"
  | "yellow"
  | "lime"
  | "light-green"
  | "green"
  | "teal"
  | "cyan"
  | "light-blue"
  | "blue"
  | "indigo"
  | "deep-purple"
  | "purple"
  | "pink"
  | "red";

Types - Dismissible

type dismissible = {
  action?: ReactNode;
  onClose: () => void;
};

Types - Animate

type animate = {
  mount?: object;
  unmount?: object;
};
Edit this page on Github