Skip to content
Site volume
Colourway

Components

Toast

A short confirmation on a slab pill at the foot of the screen. One at a time; never an error's only copy.

  • Experimental
  • Reading layer
  • Client leaf
  • Since 0.9.0
  • Press check
Import from@maxgrits/overprint-react/toast
On this page

ToastProvider and useToast confirm something that just happened: a slab pill at the bottom centre with a glyph disc, a title, an optional line and one action. One shows at a time and three wait their turn; each lives 5.2 s, and the time holds while the region is hovered or focused or the window is in the background. A toast never holds an error's only copy and never asks for a decision.

Example#

Look of this example
Live render of examples/toast/basic.tsx

Usage#

Use a toast to confirm something that just happened and needs no answer: "Draft archived", "Link copied". It prints on a slab pill at the bottom centre, above the action dock on phones.

  • One at a time. One shows, three wait; each lives 5.2 s, and the time holds while the region is hovered or focused or the window is in the background.
  • One action at most, such as "Undo", as a small secondary key.
  • Never an error's only copy, and never a question: errors live next to what caused them, decisions in a Dialog.
  • Set up once. ToastProvider wraps the app; useToast() returns toast({ title, description, action, glyph }).

Anatomy#

Draft archived

The parts of examples/toast/anatomy.tsx, numbered:
  1. PillThe slab, at least 52 px tall..mk-toast
  2. Glyph discA 26 px paper disc with the ink glyph.data-mk-part="disc"
  3. WordsThe title, and an optional line in the second slab ink.data-mk-part="text"
  4. DismissA quiet key; the region is reachable with F6..mk-toast-close

Volume#

Reading layer: identical at every volume.

  • Quiet

    Draft archived

    Docs, forms, legal and long reads. Flat inks, no art in motion.

  • Studio

    Draft archived

    The site default. Art on its own plates, one display moment per view.

  • Press

    Draft archived

    Hero moments, covers and campaigns. Halftone fields and the second ink.

  • Rave

    Draft archived

    Launches, posters and the 404. Every ink, and the words still win.

Content#

  • Past tense, the thing first: "Draft archived", "Link copied".
  • Two to four words; a second line only when it adds something, such as where the thing went.
  • The action is one verb: "Undo", "View".

Do and don't#

Do

Draft archived

Confirms a done thing.

Don't

A toast saying "Payment failed. Try another card." that disappears in five seconds.

An error that vanishes before it is read.

Toasts leave on their own. Anything a reader has to act on stays on the page, next to the field or the step that needs it.

Accessibility#

  • A polite live region; F6 moves focus to the region and the timers hold while it has focus.
  • The drain bar along the foot reads time, so it still runs under reduced motion; the rise and drop become a fade.
  • It sits above the phone dock through --mk-dock-h.
KeysWhat happens
F6Moves focus to the notifications region (timers hold while it has focus)
TabMoves to the toast's action and close keys
EnterorSpaceRuns the action or closes the toast

The colour pairs it prints, with their contrast on both papers:

TextSurfaceRoleBoneNight
--mk-on-slab--mk-slablabel 16.49:1 · Lc 98.7, passes 16.21:1 · Lc 95.1, passes
--mk-on-slab--mk-slabbody-ui 16.49:1 · Lc 98.7, passes 16.21:1 · Lc 95.1, passes
--mk-on-slab--mk-slablong 16.49:1 · Lc 98.7, passes 16.21:1 · Lc 95.1, passes
--mk-on-slab-2--mk-slabmeta 11.51:1 · Lc 75.1, passes 6.29:1 · Lc 75.2, passes

Process at Studio, normal contrast. Every look: the press check.

Props#

PropTypeDefaultDescription
children requiredReactNodenone
timeoutnumbernoneDefault life in ms (5200, `--mk-dur-toast-life`).
queuenumber3How many may wait behind the shown one (default 3).
closeLabelstringnone
labelstring"Notifications"The region's name (default "Notifications").

Generated from ToastProviderProps in packages/overprint-react/src/reading/toast/toast.tsx.

Tokens#

System tokens (19)

Its own properties (7)

  • --mk-dock-h
  • --mk-toast-gap
  • --mk-toast-leading
  • --mk-toast-life
  • --mk-toast-line-gap
  • --mk-toast-pad
  • --mk-toast-pad-start

Scanned from its CSS at build and checked against its registry entry; 8 read but not declared there.

Changelog#

Arrived in 0.9.0.

0.9.024 October 2026

  • MinorreactCombobox and ComboboxItem (a case- and accent-insensitive filter by default, groups, chips for multiple, "Searching…", an empty message, a live result count, and inline for a list printed in place), Popover with PopoverTrigger, PopoverContent and PopoverClose, Menu with its eleven parts (shortcuts as Kbd caps, checkbox and radio items, group labels, separators, submenus), and ToastProvider with useToast (a slab pill, one at a time with three waiting, 5.2 s with a drain bar that holds while the region is hovered, focused or the window is away). Read the whole entry