04.27 · Micro-Interactions

Toast Notification

Short messages slide into a corner, then leave on their own. Best for updates.

Click it

Send a toast, then tap or swipe it away early, or press Show me.

Try it

Change a setting, then try it again or press Show me.

Corner

Where toasts appear and stack.

How it comes in

How each toast arrives and leaves.

Time on screen

How long a toast stays before it leaves.

More optionsFewer options

Most at once

The oldest leaves when a new one needs room.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add toast notifications to [the actions in your app that should be confirmed quietly, such as saving]. Each toast comes into a corner of the screen with a short message and a thin bar that empties as it counts down, then leaves on its own. New toasts stack; when one leaves, the others glide over to close the gap, moved with transforms rather than by changing the layout. Pause the countdown while the pointer is over a toast, and let a tap, a sideways swipe or a close button dismiss it early. Announce each message to screen readers without moving focus. If the visitor has reduced motion turned on, show and hide toasts without movement. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Save confirmations
  • Upload updates
  • Sync notices

Avoid on

  • Errors that need action
  • Long messages