Version 2.0.0

In-line alert

In-line alerts display a non-modal message associated with objects in a view. These are often used in form validation, providing a place to aggregate feedback related to multiple fields.

Key example of an in-line alert in the negative variant, with a red outline and red alert icon. Title, Unable to process payment. Body text, There was an error processing your payment. Please check that your credit card information is correct, then try again.

Anatomy#


Image illustrating through labels the component parts of an in-line alert, including its title area, icon, body area, optional button group area, header, body, and footer.

Options#


Key example of the neutral variant of an in-line alert. Gray color border. Title, Payment information. Body text, Enter your billing address, shipping address, and payment method to complete your purchase.

Neutral variant#

The neutral variant is the default for in-line alerts. It is gray and does not have an icon. This is used for when the message is neutral in tone or when its semantics do not fit any of the other variants.

Key example of the informative variant of an in-line alert. Blue border color, with a blue information icon. Title, Accepted payment methods. Body, Only major credit cards are accepted for payment. Direct debit is currently unavailable.

Informative variant#

The informative variant uses the informative semantic color (blue) and has an "information" icon to help those with color vision deficiency discern the message tone. This should be used when the message needs to call extra attention, as compared to the neutral variant.

Key example of the positive variant of an in-line alert. Green border color, with a green information icon. Title, Purchase completed. Body text, You’ll get a confirmation email with your order details shortly.

Positive variant#

The positive variant uses the positive semantic color (green) and has a "checkmark" icon to help those with color vision deficiency discern the message tone. This should be used to inform someone of a successful function or result of an action they took.

Key example of the notice variant of an in-line alert. Orange border color, with an orange alert icon. Title, Update payment information. Body text, The saved credit card for your account has expired. Update your payment information to complete the purchase.

Notice variant#

The notice variant uses the notice semantic color (orange) and has an "alert" icon to help those with color vision deficiency to discern the message tone. This can be used to warn about a situation that may need to be addressed soon.

Key example of the negative variant of an in-line alert. Red border color, with a red alert icon. Title, Unable to process payment. Body text, There was an error processing your payment. Please check that your credit card information is correct, then try again.

Negative variant#

The negative variant uses the negative semantic color (red) and has an "alert" icon to help those with color vision deficiency to discern the message tone. This can be used to show an error or a failure, or to convey something that needs to be immediately acknowledged or addressed.

Table of options#

From the design point of view, each component has a number of options. These options and their names are platform agnostic, and each implementation should adapt these to fit into their framework.

PropertyValuesDefault Value
neutral
neutral / informative / positive / notice / negative
neutral

Composition#


Image showing the composition of the title area of an in-line alert in relation to other parts of the component. An informative variant with a blue outline and a blue information icon. Title, Accepted payment methods.

Title area#

The title area is reserved for the text that will be the title of the alert. This area should contain an extra-extra-small heading component.

Image showing the composition of the body area of an in-line alert in relation to other parts of the component. An informative variant with a blue outline and a blue information icon. Body text, Only major credit cards are accepted for payment. Direct debit is currently unavailable.

Body area#

The body area is reserved for the main content or the description of the alert. This area should contain a small body component.

Image showing the composition of the optional button group area of an in-line alert in relation to other parts of the component. An informative variant with a blue outline and a blue information icon. One primary button, label OK.

Button group area#

The button group area is optional for including any buttons that would help a user take a direct action related to the alert message. If the alert can be dismissed, add a primary button with an "OK" label.

Behaviors#


Key example of the text overflow behavior for the title of an in-line alert. Negative variant of an in-line alert with a red border and red alert icon. Title text wrapped to 2 lines, (500 Internal Server Error) Unable to process payment at this time. Body text, Please check that your credit card information is correct, then try again.

Text overflow#

When the title of an in-line alert is too long for the available horizontal space, it wraps to form another line. The optional icon in the top-right corner stays aligned to the top.

Internationalization#


Key example of an in-line alert in a right-to-left language. Informative variant, with a blue border and blue information icon. Text in Arabic. Title, Accepted payment methods. Body text, Only major credit cards are accepted for payment. Direct debit is currently unavailable. Button label, OK.

RTL#

For RTL (right-to-left) languages, the layout of the in-line alert is mirrored. The icon and dismiss button are both left-aligned.

Keyboard interactions#


KeyInteraction
TabPlaces the focus on the next interactive element, which is the dismiss button, if there is one.
Shift + TabPlaces the focus on the previous interactive element, which is the dismiss button, if there is one.

Changelog#


DateNumberNotes
Aug 21, 20202.0.0
  • Added table of options
  • Added text overflow behavior
  • Added RTL (right-to-left) guidelines
  • Added keyboard interactions guidelines
Feb 10, 20201.0.0
  • This component has been added to the website

Design checklist#


N/A

All interactive states

Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

All color themes

Works properly across all four color themes (lightest, light, dark, darkest).

All platform scales

Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).

Accessible use of color

Color is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

Accessible contrast for text

Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).

Accessible contrast for UI components

Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).

Content design

UI language and information design considerations have been incorporated into component design.

N/A

Defined options

Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

Defined behaviors

Includes guidelines for keyboard focus, layout (wrapping, truncation, overflow), animation, interactions, etc.

Usage guidelines

Includes a list of dos and don'ts that highlight best practices and common mistakes.

Writing guidelines

Includes content standards or usage guidelines for how to write or format in-product content for the component.

Internationalization guidelines

Works properly across various locales and includes guidelines for bi-directionality (RTL).

Keyboard interactions

Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

Design tokens

All design attributes (color, typography, layout, animation, etc.) are available as design tokens.

UI kit

Includes a downloadable XD file that shows multiple options, states, color themes, and platform scales.

Generated UI kit

Includes a downloadable XD file, generated by code using design tokens defined in Spectrum DNA, and shows multiple options, states, color themes, and platform scales.

N/A

In Spectrum for Adobe XD plugin

Component is included in the Spectrum for Adobe XD plugin.