Notifications

The design system provides three notification components for different use cases: alerts for inline messages, toasts for transient confirmations, and modals for blocking interactions that require user decisions.

Choosing the Right Pattern

PatternComponentUse WhenPersistenceUser Action Required
Alerteds-alertContextual info, warnings, errors inline with contentPersistent until dismissedOptional (dismissible)
Toasteds-toastBrief confirmations, status updatesAuto-dismiss or manual closeNo
Modaleds-modalCritical decisions, confirmations, complex inputUntil user respondsYes

Alert

Inline, persistent messages that sit within the page content. Use for warnings, errors, success confirmations, and contextual information.

Intents

IntentUse ForBackground
defaultGeneral informationGrey
warningCaution, review neededYellow
errorFailure, invalid inputRed
successConfirmation, completed actionGreen
brandEBRAINS-branded messagingDark with green text
infoAlias for defaultGrey

Basic Usage

Actions

Alerts support two types of actions:

  • Link — when pressable-url is set, renders an eds-link with intent="strong"
  • Button — when only pressable-label is set (no URL), renders an eds-button with intent="ghost"

Layout

Use direction="vertical" for alerts with longer messages or multiple actions:

Slot Content

For rich content with HTML markup, use the slot instead of the message prop:

Toast

Transient notifications that appear briefly and auto-dismiss. Use for non-critical confirmations that don’t require user action.

Intents

IntentUse For
defaultGeneral confirmation
successAction completed
errorNon-critical failure
warningCaution notice
brandBrand-styled (dark bg, green text)
brandInverseBrand-styled (light bg, dark text)

Basic Usage

When to Use Toast vs Alert

ScenarioUse
“File uploaded successfully”Toast — transient confirmation
“Your session will expire soon”Alert — persistent warning needs attention
“Network error, retrying…”Toast — temporary status
“Required field is missing”Alert (inline) — needs user action
“Saved!”Toast — brief acknowledgment
“This action cannot be undone”Modal — blocking confirmation

Modal

Blocking overlays for critical interactions. The modal traps focus, locks body scroll, and requires the user to respond before continuing.

Sizes

SizeWidthUse For
small500pxSimple confirmations, short messages
medium700pxForms, detailed content
large900pxComplex layouts, data tables

Basic Usage

Position

PositionDescription
middleCentered vertically (default)
topAligned to top of viewport
bottomAligned to bottom of viewport

Accessibility

The modal automatically:

  • Traps focus within the modal content (Tab cycles through focusable elements)
  • Closes on Escape key press
  • Locks body scroll while open
  • Restores focus to the trigger element on close
  • Uses role="dialog" with aria-label

Best Practices

  • Don’t stack toasts — limit to 1-2 simultaneous toasts
  • Keep toast messages under 90 characters — they should be scannable
  • Use alerts for errors that need action — toasts auto-dismiss and can be missed
  • Don’t use modals for non-blocking info — use alerts or toasts instead
  • Always provide a dismiss path — modals must have a close button or cancel action
  • Match intent to severityerror for failures, warning for caution, success for confirmations
  • Combine patterns — show a toast after a modal confirmation (“Item deleted”), use an alert for persistent errors that need resolution

Component Reference