Components · Notifications

Inline notification

An inline notification gives feedback right where the user is working: next to a form, a quantity field or a delivery estimate. It stays in the page until the user acts or the state changes. It never disappears by itself.

The buttons in In action show the statuses appearing in context. Figma: Inline notification.

Playground

Choose size, status, emphasis and layout and the notification and its code update. The × works; Show again brings it back.

Size
Emphasis
Layout
Title
Close button

The animation when the × is clicked is set in Motion.

Markup for this selection

HTML

The markup has no motion. Closing animation is set in Motion.


In action

Two real situations. The notification appears where the work is, replaces the previous one, and stays until the user fixes the problem or closes it.

Change password (form feedback)

Each button submits the form with a different result. The notification replaces the previous one and stays until it is closed.

Quantity (product information)

Informational Weak with its own icon. The message follows the quantity.


Overview

An inline notification gives feedback right where the user is working: next to a form, a quantity field or a delivery estimate. It stays in the page until the user acts or the state changes. It never disappears by itself.

It is a task-generated notification. A brief confirmation belongs in a Toast, and a message for the whole page or system in a Banner. Not sure it is the right component? Start at the Notifications guide.

This documentation has three pages. Examples & Guidelines (this page) shows when and how to use an inline notification. Specifications holds the values: tokens, sizes, measurements, states and requirements. Code shows how to build one and the CSS behind it.


Usage

When to use

Use an inline notification for status that belongs to one place on the page and has to stay. Use it to:

  • Give feedback on a form: a missing field, a weak password, a declined payment
  • Show helper information next to the content it is about, such as stock or delivery time
  • Offer a way to fix a problem from where it appears, with Actionable buttons or links

When not to use

Next to the thing it is about

An inline notification sits in the region of the work. A banner at the top of the page is for the whole site, and is too far away from a form.

Do place the notification next to the form it is about.
Do not use a banner for feedback on a form. Use an inline notification instead.

Strong for a problem the user must fix

Weak is the default, for feedback the user can already see, such as helper information. Strong is for a problem the user must fix. See Choosing the emphasis.

Do use Strong for a problem the user must fix.
Do not use Strong for helper information. Weak is the default.

It stays

An inline notification never disappears by itself. For a brief confirmation that leaves on its own, use a Toast.

Do use an inline notification for information that stays.
Do not use it for a brief confirmation. Use a Toast instead.

Quick reference

The message…Use
belongs to one section, form or content block and must stayInline (this page)
is a short confirmation of an actionToast
concerns the whole page or systemBanner
needs a decision before the user can go onModal

Do

  • Place it next to the thing it is about.
  • Give an Error a way to fix it, in the text or as an action.
  • Use Informational for helper messages such as stock or delivery.
  • Announce it with aria-live when it appears after an action.

Don’t

  • Use it for a single field. Use the field’s own error message.
  • Use it for a brief confirmation. Use a Toast.
  • Add the Actionable layout to Small.
  • Use the Weaker emphasis. That is Banner only.

Anatomy

Inline notification

  1. Left edge. 2px, in the status color.
  2. Status icon. 24px (Small 20px). Informational may take an icon of its own.
  3. Title. Optional. label-sm, uppercase.
  4. Text. body-sm, 14/20.
  5. Close. A Blank icon button, 20px icon.
  6. Actions. Actionable (Large only): buttons or inline links.

Variants

Two sizes, two emphasis levels and two layouts. Pick the size by how much room the message has, and the emphasis by how loud it should be: Weak for feedback the user can already see, Strong for a problem the user must fix. See Choosing the emphasis.

Large

48px high with a 24px icon. The default for messages next to forms and content blocks.

Small

32px high with a 20px icon, for tight spaces such as next to a field. No Actionable layout. Weak exists only for Informational and Warning.

Actionable

Large only. Buttons under the text, indented 32px so they line up with it. Use it when the user can fix the problem from here.

Actionable with inline links

The action area holds either buttons or inline links, not both. Links suit lighter next steps.

Informational with your own icon

Informational Weak is white with a blue edge. Like any Informational notification it may carry an icon the author chooses instead of the default info: a Google Material Symbols name, shown as Outlined (Fill 0, Weight 300, Grade 0). Success, Warning and Error always keep their own filled icon.


Sizes

Large is 48px high with a 24px icon and 12px padding. Small is 32px high with a 20px icon and 4px padding. An inline notification is the same at every breakpoint. All values are under Sizes in Specifications.

Large

Small


Layout & Appearance

Alignment

The icon, the text and the × sit on one row, top-aligned. In the Actionable layout the buttons or links start 32px from the edge, under the text.

Placement

Next to the thing it is about: above or below a form, beside a quantity field or a delivery estimate. It is part of the page flow and moves the content around it.

Width

An inline notification takes the width of its container.

Appearance

Strong has a tinted background and a 1px outline; Weak is white. Both have a 2px status edge and the elevation b-20. Token names and values are under Design Tokens in Specifications.


Behavior

Dismissal

The × hides the notification with a fade and a height collapse, so no gap is left.

Persistence

It stays until the user acts, the state changes or it is closed. It never auto-hides.

Hover and focus

Only the ×, the buttons and the links have states. They take focus with a visible ring, on keyboard use only. All states are under States in Specifications.

Motion

Closing is a fade and a collapse: accelerate easing, 150ms. Try other values under Motion above, and see Motion in Specifications.


Accessibility

All requirements are listed under Accessibility Requirements in Specifications.

Keyboard support

Tab moves to the ×, the buttons and the links, each with a visible focus ring.

Screen reader support

Put the notification in a region with aria-live="polite" (role="alert" for errors that block progress) so it is announced when it appears. The status is carried by the icon and the text, not by color alone.