Back to compare picker

Warning text vs Alert vs Inline message vs Error summary

Use warning text for a concise severe-consequence warning tied to an instruction or action; use alert for urgent current-task status, inline message for local object feedback, and error summary for submitted-form recovery.

Learn the decision

Match the interaction to the person's task

Use warning text for a concise severe-consequence warning tied to an instruction or action; use alert for urgent current-task status, inline message for local object feedback, and error summary for submitted-form recovery.

Warning text

Use it when: A user must understand a serious consequence before taking or skipping an action.

Make this state clear: Before-action warning state placed immediately before the related control or declaration.

Observe the result: Users see the fine or eligibility consequence before checking the declaration and can pause to verify their answer.

Study the full pattern →

Alert

Use it when: A current task has a time-sensitive warning, error, or important status change.

Make this state clear: Advisory or success state that uses calmer status semantics rather than assertive alert semantics.

Observe the result: When the connection returns, the alert downgrades to a success status and then can be dismissed safely.

Study the full pattern →

Inline message

Use it when: A visible object or section has local status, warning, success, or next-step information.

Make this state clear: Informational inline message attached to the relevant object or section.

Observe the result: A successful send message remains beside the invoice long enough to copy the generated reference.

Study the full pattern →

Error summary

Use it when: Form submission can produce one or more errors.

Make this state clear: Failed-submit state with summary visible near the form heading.

Observe the result: After failed submit, focus or reading order makes the summary discoverable before users scan the form.

Study the full pattern →

Practice the judgment: Imagine this situation: A legal consequence is buried in ordinary hint text below the submit button, so users miss it before applying. Write the person's goal, choose one of these patterns, and show the state that helps the person continue. Use the decision rules and source trail below to explain your choice.

Review the underlying principle →

Decision dimensions

Dimension Warning textAlertInline messageError summary
UI or UX UI + UX - Severe-consequence warning copy before an actionUI + UX - Urgent current-task status messageUI + UX - Contextual in-flow feedbackUI + UX - Form recovery summary
UI guidance Render warning text as a short high-emphasis statement with a warning icon, visible or hidden warning label, and explicit consequence copy placed before the relevant action, declaration, or instruction.Render an alert as a visible message in the current task area with a clear severity cue, short title, consequence-focused body, and one direct action or safe dismissal when appropriate.Render the message inside the same row, card, panel, form section, or task region that it describes, with a clear tone, concise title, body text, and at most one local action or detail disclosure.Render a top-of-form summary block with heading, linked error list, and matching field-level error messages.
UX guidance Use warning text when users must understand a serious consequence before acting or failing to act, such as a fine, loss of access, permanent deletion, eligibility impact, or legal responsibility.Use alerts when the user must notice a time-sensitive condition that affects their current task, such as session expiry, lost connection, unsaved work risk, failed submission, or a security-sensitive hold.Use inline messages when users need contextual feedback while continuing nearby work, such as a row-level warning, section-level success, local policy note, or task-specific next step.Move users from the summary to the exact field, group, or first invalid control that needs correction.
Good UI Before Submit declaration, a warning with an exclamation icon says the user may be fined if they provide false information.A session alert appears above the active editor, says the session expires in 2 minutes, and offers Save draft while keeping the editor usable.An invoice row shows Missing billing contact directly beneath the affected customer with Add contact as the only action.Top-of-form summary with a clear heading, linked error list, and matching inline field messages.
Bad UI A red sentence says Important below the submit button after the user has already acted.Users miss an urgent condition because the message auto-expires or appears far from the affected task.A section message contains a full support workflow, several links, and unrelated settings controls.Summary and field messages visually disconnected or contradictory.
Good UX Users see the fine or eligibility consequence before checking the declaration and can pause to verify their answer.When the connection returns, the alert downgrades to a success status and then can be dismissed safely.A successful send message remains beside the invoice long enough to copy the generated reference.After failed submit, focus or reading order makes the summary discoverable before users scan the form.
Bad UX Users incur a penalty because the warning looked like ordinary hint text.The only warning that unsaved work will be lost disappears after five seconds.The message disappears like a toast even though users still need the invoice reference.Only showing errors below the fold.
Best fit A user must understand a serious consequence before taking or skipping an action.A current task has a time-sensitive warning, error, or important status change.A visible object or section has local status, warning, success, or next-step information.Form submission can produce one or more errors.
Avoid when The message is a dynamic task status that must be announced when it appears.The message belongs beside one object, row, field, or local section.The message is a one-field validation correction.The message is a system failure, permission problem, or outage rather than a validation issue.
Required state Before-action warning state placed immediately before the related control or declaration.Advisory or success state that uses calmer status semantics rather than assertive alert semantics.Informational inline message attached to the relevant object or section.Failed-submit state with summary visible near the form heading.
Accessibility burden Keep the warning in reading order before the control, declaration, or instruction it qualifies.Use role alert for urgent dynamic text and avoid putting interactive controls inside the role-alert node itself.Keep the message in the reading order near the context it describes.Use a heading and alert behavior that makes the summary discoverable.
Common misuse Using warning text for routine hints, explanations, or mild reminders.Using a disappearing toast for warnings users must act on before continuing.Using an inline message for a single field error that should be connected to that input.Replacing field-level messages with only a top-level summary.

Warning text

UI or UX
UI + UX - Severe-consequence warning copy before an action
UI guidance
Render warning text as a short high-emphasis statement with a warning icon, visible or hidden warning label, and explicit consequence copy placed before the relevant action, declaration, or instruction.
UX guidance
Use warning text when users must understand a serious consequence before acting or failing to act, such as a fine, loss of access, permanent deletion, eligibility impact, or legal responsibility.
Good UI
Before Submit declaration, a warning with an exclamation icon says the user may be fined if they provide false information.
Bad UI
A red sentence says Important below the submit button after the user has already acted.
Good UX
Users see the fine or eligibility consequence before checking the declaration and can pause to verify their answer.
Bad UX
Users incur a penalty because the warning looked like ordinary hint text.
Best fit
A user must understand a serious consequence before taking or skipping an action.
Avoid when
The message is a dynamic task status that must be announced when it appears.
Required state
Before-action warning state placed immediately before the related control or declaration.
Accessibility burden
Keep the warning in reading order before the control, declaration, or instruction it qualifies.
Common misuse
Using warning text for routine hints, explanations, or mild reminders.

Alert

UI or UX
UI + UX - Urgent current-task status message
UI guidance
Render an alert as a visible message in the current task area with a clear severity cue, short title, consequence-focused body, and one direct action or safe dismissal when appropriate.
UX guidance
Use alerts when the user must notice a time-sensitive condition that affects their current task, such as session expiry, lost connection, unsaved work risk, failed submission, or a security-sensitive hold.
Good UI
A session alert appears above the active editor, says the session expires in 2 minutes, and offers Save draft while keeping the editor usable.
Bad UI
Users miss an urgent condition because the message auto-expires or appears far from the affected task.
Good UX
When the connection returns, the alert downgrades to a success status and then can be dismissed safely.
Bad UX
The only warning that unsaved work will be lost disappears after five seconds.
Best fit
A current task has a time-sensitive warning, error, or important status change.
Avoid when
The message belongs beside one object, row, field, or local section.
Required state
Advisory or success state that uses calmer status semantics rather than assertive alert semantics.
Accessibility burden
Use role alert for urgent dynamic text and avoid putting interactive controls inside the role-alert node itself.
Common misuse
Using a disappearing toast for warnings users must act on before continuing.

Inline message

UI or UX
UI + UX - Contextual in-flow feedback
UI guidance
Render the message inside the same row, card, panel, form section, or task region that it describes, with a clear tone, concise title, body text, and at most one local action or detail disclosure.
UX guidance
Use inline messages when users need contextual feedback while continuing nearby work, such as a row-level warning, section-level success, local policy note, or task-specific next step.
Good UI
An invoice row shows Missing billing contact directly beneath the affected customer with Add contact as the only action.
Bad UI
A section message contains a full support workflow, several links, and unrelated settings controls.
Good UX
A successful send message remains beside the invoice long enough to copy the generated reference.
Bad UX
The message disappears like a toast even though users still need the invoice reference.
Best fit
A visible object or section has local status, warning, success, or next-step information.
Avoid when
The message is a one-field validation correction.
Required state
Informational inline message attached to the relevant object or section.
Accessibility burden
Keep the message in the reading order near the context it describes.
Common misuse
Using an inline message for a single field error that should be connected to that input.

Error summary

UI or UX
UI + UX - Form recovery summary
UI guidance
Render a top-of-form summary block with heading, linked error list, and matching field-level error messages.
UX guidance
Move users from the summary to the exact field, group, or first invalid control that needs correction.
Good UI
Top-of-form summary with a clear heading, linked error list, and matching inline field messages.
Bad UI
Summary and field messages visually disconnected or contradictory.
Good UX
After failed submit, focus or reading order makes the summary discoverable before users scan the form.
Bad UX
Only showing errors below the fold.
Best fit
Form submission can produce one or more errors.
Avoid when
The message is a system failure, permission problem, or outage rather than a validation issue.
Required state
Failed-submit state with summary visible near the form heading.
Accessibility burden
Use a heading and alert behavior that makes the summary discoverable.
Common misuse
Replacing field-level messages with only a top-level summary.
Decision rules
  • Choose warning text when users need to understand a serious consequence of doing or not doing an action before they continue, such as a fine, loss of eligibility, deletion, or legal responsibility.
  • Choose alert when a time-sensitive system or task condition appears dynamically and must be noticed immediately, such as session expiry, lost connection, or payment hold.
  • Choose inline message when the warning belongs beside one visible row, panel, field group, card, or task section and should stay attached to that local object.
  • Choose error summary when the user already submitted a form and needs a linked list of invalid answers plus matching field-level correction messages.
  • Use warning text before the relevant action, checkbox, declaration, or instruction so users can change behavior before the consequence happens.
  • Do not use warning text as a catch-all red box for service outages, system status, validation failures, or previous-page confirmations; those need alert, banner, error summary, or notification banner treatment.
  • Do not rely on an icon or warning color alone; include visible consequence copy and hidden or visible warning wording so the meaning survives color loss and screen-reader navigation.
  • Escalate from warning text to confirmation dialog only when the user must actively choose whether a high-consequence action proceeds.
Inspect live examples
Failure modes
  • A legal consequence is buried in ordinary hint text below the submit button, so users miss it before applying.
  • A page uses warning text for three routine help notes, training users to ignore the one severe warning.
  • A failed form submission shows warning text instead of an error summary with links to invalid answers.
  • A live session-expiry condition appears as static warning text and is not announced when it changes.
  • A row-level data-loss warning is shown at the top of the page, losing the affected object.
  • A destructive action proceeds after warning text even though policy requires an explicit confirmation decision.

Saved items