Alert Button

Alert buttons are interactive components that trigger specific actions while communicating urgency or importance through visual styling.

alertBtn/main

Resources

Intro & Anatomy

Alert buttons are interactive components that help users take action while providing immediate visual feedback about the nature or consequence of the action. Use alert buttons for actions that require user attention or communicate status, e.g. confirming deletions, saving changes, or acknowledging warnings.

Alert buttons maintain standard button functionality whilst incorporating visual cues through colour and styling to convey meaning.

MDX offers alert buttons with optional icons and multiple sizing options for different interface requirements.

alertBtn/anatomy

 


 

Options & Styles

Variants

MDX offers three variants of alert buttons:

Success for positive actions and confirmations
Error for destructive or critical actions
Warning for cautionary actions requiring attention

alertBtn/label

Label & Icon

Labels are always required for alert buttons to clearly communicate the action and its consequence or importance level.

Icons are optional. Icons can be placed left or right of the label text.

alertBtn/labelIcon

Type

MDX offers 3 alert button variants for clear visual hierarchy:

Primary for main actions
Secondary for secondary actions
Tertiary for supporting actions styled as text links

alertBtn/types

Sizes

MDX alert buttons come in two different sizes:
small and medium.

Medium is the default size and should be used in most cases unless specific design requirements call for a different size.

alertBtn/size

Disabled Buttons

A disabled alert button shows that an action exists but isn't currently available, like when a form hasn't been completed.

We recommend avoiding disabled buttons when possible, as they don't explain why the button isn’t usable, and aren't accessible via keyboard navigation.

btn/disabled

 


 

Best Practice & Usage

Alert buttons should communicate their purpose clearly using appropriate visual styling and descriptive labels. Use alert buttons when the action's consequence or importance needs immediate visual recognition.

alertBtn/usage/do1
alertBtn/usage/dont1
alertBtn/usage/do2
alertBtn/usage/don2
alertBtn/usage/do3
alertBtn/usage/dont3

 


 

Theming

You can customise colours, border width and radius, font styles, spacing, and paddings. When not using MDX icons, a slot is available to use your own icon library or SVG icons.

We recommend not changing the medium button height as it meets the minimum accessibility criteria requirements.

We further suggest maintaining clear visual distinction between alert types whilst ensuring adequate colour contrast for accessibility compliance.