Skip to content

MazAlert ​

MazAlert is an accessible component for displaying contextual feedback messages like success, warning, error, or informational notifications with customizable colors, icons, and styling options

Before use it, you should install the MazUi plugin in your project, follow instructions in Getting Started

Basic usage ​

Variants ​

MazAlert supports two visual variants: soft (default) with transparent background, and solid with full color background.

Soft variant (default) ​

The soft variant uses a transparent background with colored text.

Solid variant ​

The solid variant uses the full color as background with contrasting text.

All colors with solid variant ​

Colors ​

MazAlert supports all theme colors to convey different types of messages.

With slots ​

Use slots for more complex content with custom HTML.

Without border ​

Remove the border with :bordered="false".

Rounded sizes ​

Customize the border radius with the rounded-size prop.

Hide icon ​

Hide the default icon with hide-icon.

Custom icon ​

Provide a custom icon using the icon prop.

Title only or content only ​

You can use either title, content, or both.

Use cases ​

Form validation errors ​

Success notification ​

Warning message ​

Props ​

NameDescriptionTypeRequiredDefaultPossible values
titleTitle of the alertstringNoundefined-
contentContent of the alertstringNoundefined-
iconIcon of the alert - can be a component or icon name stringIconComponent | stringNoundefined-
hide-iconHide the iconbooleanNofalse-
colorColor of the alertMazAlertColorNoinfo'success' | 'warning' | 'destructive' | 'info' | 'primary' | 'secondary' | 'accent' | 'contrast'
icon-sizeSize of the iconMazIconProps['size']Nomd-
rounded-sizeSize of the rounded cornersMazAlertRoundedSizeNobase'none' | 'sm' | 'md' | 'base' | 'lg' | 'xl' | '2xl' | '3xl'
borderedAdd border to the componentbooleanNotrue-
variantVisual variant of the alertMazAlertVariantNosoft'soft' | 'solid'

Slots ​

NameDescriptionBindings
titleTitle slot - overrides title prop
defaultDefault slot for alert content - overrides content prop