Accessibility

  • Write the message into a live region that is already on the page (role="status"), so screen readers announce it without moving focus.
  • Never move focus to the snackbar. Undo must also be reachable without it: in the item's menu, or with Ctrl+Z (⌘Z).
  • While a screen reader is running, a snackbar with an action stays until it is closed. Escape closes it when focus is inside.
  • Contrast: on-ink on ink is 16.7:1 in light and 15.9:1 in dark; the accent-on-ink action 8.4:1 and 6.5:1. The focus ring on ink is accent-on-ink too: the usual accent ring falls to 2.3:1 and 1.8:1 there (computed from the tokens).
  • Its buttons are 36 px, above the 32 px web minimum; on phones give them a 48 px hit area, the full height of the bar.