search⌘K

Alert Button

Last Updated: September 2026

Alert buttons are a button style reserved for use ONLY inside of alerting elements such as toasts, banner, or notifications.

Anatomy

link
Dotted grid scale: 8px
  1. 1Primary
  2. 2Secondary
  3. 3Tertiary

Variants

link

Primary

Strong semantic fill. Pair with matching intent.

Secondary

Subtle semantic background for a supporting action.

Tertiary

Text-only. Common for dismiss actions.

Intents

intent drives semantic colors: info, success, warning, danger.

Usage Guidelines

link

When to use

  • •For actions embedded in Banner, AlertNotification, or similar messaging UI.
  • •When the button color should match the alert intent (info, success, warning, danger).
  • •For compact confirm / dismiss pairs inside an alert.

When not to use

  • •For page-level CTAs — use Button instead.
  • •For navigation between pages — use Link.
  • •Outside messaging surfaces where semantic intent colors are not needed.
checkDo

Match variant+intent to the parent alert and keep labels short.

closeDon't

Don't use AlertButton as a general page CTA — use Button.

checkDo

Use danger intent only for destructive or blocking alert actions.

closeDon't

Don't mix intents in one alert — keep actions on the same intent.

Behaviors

link

Required props

  • •variant and intent are both required.
  • •Renders a native button with type="button".

Composition

  • •Banner and AlertNotification wire AlertButton for action / dismissAction slots.
  • •Prefer those slots when building alerts so styling stays consistent.

Content Guidelines

link

Labels

  • •Use short verb phrases ('Review', 'Reschedule', 'Dismiss').
  • •Sentence case; avoid vague labels like 'OK'.

Accessibility

link

Text & Labels

  • •Provide a clear visible label — AlertButton has no icon-only mode.
  • •Ensure the parent alert already exposes role="alert" context.

ARIA attributes

  • •Standard button semantics; disabled via the disabled attribute when needed.

Keyboard Support

  • •Tab → focus.
  • •Space / Enter → activate.

WCAG Compliance Standards

FAQs

link

Should I use AlertButton or Button inside alerts?

Use AlertButton so colors track the alert intent. Use Button for non-messaging UI.

How do Banner and AlertNotification use this?

They map action to primary and dismissAction to tertiary with the alert's intent.

Can I omit intent?

No — intent is required and selects the semantic color tokens.

link