Toast Notifications for Power Apps
A toast is a small card that appears at the edge of the screen after something happens, such as a record being saved, and goes away on its own or when the user closes it. Power Apps has Notify() for a plain banner at the top; reach for these when you want your own text, icon, timing and position. The basic toasts show one message. The save toasts (Tab Toast, Morph Toast and Toast Deck) follow a whole save: Saving while your Patch runs, then Saved or the real error message. Every toast pastes with a demo button, follows the light or dark theme and comes as Classic and Modern YAML. Toast Notification is free; the others need a paid plan, and editing the settings needs any paid plan except the old Components subscription.
Pick a variant
- Toast NotificationFreeClassic, Modern
The full toast: icon, title, text, an action such as Undo and a close X. It slides in from the nearest edge and closes itself with a time bar
Settings: Switches for Demo button, Round icon, Close X, Action button, Slide in, Close by itself and Time bar (the bar needs Close by itself); Kind: Success, Error, Warning or Info (brand color); Position, one of six places; Closes after (seconds); Title; Text; Action button; Demo button
- Tab ToastPaidClassic, Modern
One save: a tab that says Saving while your Patch runs, then a card with Saved and the time, or the real error. Dark in the light theme and light in the dark theme
Settings: Switches for Demo button, Action button, Dismiss button and Close by itself when saved; Position; Demo save ends with (Saved or An error); A saved toast closes after (seconds); the tab word While saving, When saved and When it fails; Record; a message and an action for saved and for failed; Demo button
- Morph ToastPaidClassic, Modern
One save: a pill with a spinner that opens into a card with the result, one action and a time bar, then shrinks back into a pill
Settings: Switches for Demo button, Action button, Close by itself when saved and Time bar (the bar needs Close by itself when saved); Position; Demo save ends with; A saved toast closes after (seconds); the pill word While saving, When saved and When it fails; a message and an action for saved and for failed; Demo button
- Toast DeckPaidClassic, Modern
Many saves: each one adds a toast to a deck with the newest in front. A tap fans the deck out into a short history with Clear all
Settings: Switches for Demo button and Close by itself when saved; Position; Demo save ends with; A saved toast closes after (seconds); a Title and a Line below for While saving, When saved and When it fails; Demo button
- Simple NotificationPaidClassic, Modern
A card with an icon, a title and one line of text that stays until the X is clicked
Settings: Switches for Demo button, Round icon and Close X; Kind; Position; Title; Text (empty for none); Demo button
- Notification with TimerPaidClassic, Modern
The same card, but it closes itself after the set time, with a time bar along the bottom
Settings: Switches for Demo button, Round icon, Close X and Time bar; Kind; Position; Closes after (seconds); Title; Text (empty for none); Demo button
- Status NotificationsPaidClassic, Modern
One short line with a round icon for quick confirmations such as Saved or Deleted. It stays until the X is clicked
Settings: Switches for Demo button, Round icon and Close X; Kind; Position; Text; Demo button
- Queue NotificationsPaidClassic, Modern
Several one-line toasts stacked on top of each other, each closing itself after the set time or with its X
Settings: Switches for Demo button and Round icon; Kind; Position; Closes after (seconds); Text of each toast; Demo button
| Component | Plan | YAML | What it is for | Settings you can change |
|---|---|---|---|---|
| Toast Notification | Free | Classic, Modern | The full toast: icon, title, text, an action such as Undo and a close X. It slides in from the nearest edge and closes itself with a time bar | Switches for Demo button, Round icon, Close X, Action button, Slide in, Close by itself and Time bar (the bar needs Close by itself); Kind: Success, Error, Warning or Info (brand color); Position, one of six places; Closes after (seconds); Title; Text; Action button; Demo button |
| Tab Toast | Paid | Classic, Modern | One save: a tab that says Saving while your Patch runs, then a card with Saved and the time, or the real error. Dark in the light theme and light in the dark theme | Switches for Demo button, Action button, Dismiss button and Close by itself when saved; Position; Demo save ends with (Saved or An error); A saved toast closes after (seconds); the tab word While saving, When saved and When it fails; Record; a message and an action for saved and for failed; Demo button |
| Morph Toast | Paid | Classic, Modern | One save: a pill with a spinner that opens into a card with the result, one action and a time bar, then shrinks back into a pill | Switches for Demo button, Action button, Close by itself when saved and Time bar (the bar needs Close by itself when saved); Position; Demo save ends with; A saved toast closes after (seconds); the pill word While saving, When saved and When it fails; a message and an action for saved and for failed; Demo button |
| Toast Deck | Paid | Classic, Modern | Many saves: each one adds a toast to a deck with the newest in front. A tap fans the deck out into a short history with Clear all | Switches for Demo button and Close by itself when saved; Position; Demo save ends with; A saved toast closes after (seconds); a Title and a Line below for While saving, When saved and When it fails; Demo button |
| Simple Notification | Paid | Classic, Modern | A card with an icon, a title and one line of text that stays until the X is clicked | Switches for Demo button, Round icon and Close X; Kind; Position; Title; Text (empty for none); Demo button |
| Notification with Timer | Paid | Classic, Modern | The same card, but it closes itself after the set time, with a time bar along the bottom | Switches for Demo button, Round icon, Close X and Time bar; Kind; Position; Closes after (seconds); Title; Text (empty for none); Demo button |
| Status Notifications | Paid | Classic, Modern | One short line with a round icon for quick confirmations such as Saved or Deleted. It stays until the X is clicked | Switches for Demo button, Round icon and Close X; Kind; Position; Text; Demo button |
| Queue Notifications | Paid | Classic, Modern | Several one-line toasts stacked on top of each other, each closing itself after the set time or with its X | Switches for Demo button and Round icon; Kind; Position; Closes after (seconds); Text of each toast; Demo button |
Paid means any paid plan (which plan do I need?). Classic and Modern are the two Power Apps control sets you can pick from the Copy YAML button. Open the category in the library: Toast.
To copy a variant into Power Apps Studio, follow Getting Started.
After you paste
Move the job of the demo button, such as btnToastTrigger, to your own button or form, then delete it. The variables are context variables, so your formula must run on the same screen as the toast. Names use your prefix settings; timers have fixed names without a prefix.
Each basic card has its own variable, so two toasts on one screen never open each other: varShowToast shows conToastCard (Toast Notification), varShowNotice shows conNoticeCard (Simple Notification), varShowTimedNotice shows conTimedNoticeCard (Notification with Timer) and varShowStatus shows conStatusCard (Status Notifications). Put this in the OnSelect property of your own button, after your Patch, or in the OnSuccess property of a form, with the names of your toast:
UpdateContext({ varShowToast: true, varToastRuns: varToastRuns + 1 })
The second variable counts the showings. The time bar image reads it, so its animation starts again every time.
Queue Notifications keeps its toasts in the collection colToastQueue. The gallery galQueue shows them, five rows high at most, with the one that expires last on top. The repeating timer QueueSweep removes every row whose ExpiresAt time has passed. Add a toast like this:
Collect(colToastQueue, {
ID: GUID(),
Message: "Item added to the cart",
ExpiresAt: DateAdd(Now(), 3000, TimeUnit.Milliseconds)
})
Tab Toast and Morph Toast keep their state in one text variable: "busy" while the save runs, "ok" when it worked, "err" when it failed, and blank while hidden. Put this in the OnSelect property of your Save button with your own Patch. For Morph Toast, write varMorphToast wherever it says varTabToast:
UpdateContext({ varTabToastState: "busy", varTabToastAt: Now(), varTabToastRuns: varTabToastRuns + 1 });
IfError(
Patch(Orders, ThisItem, { Status: "Shipped" }),
UpdateContext({ varTabToastState: "err", varTabToastError: FirstError.Message }),
UpdateContext({ varTabToastState: "ok" })
)
IfError runs its second part when the save fails and its third when it works. FirstError.Message is the real reason and replaces the error text from Settings.
Toast Deck adds a row to the collection colToastDeck for every save and updates that row when the save ends:
With({ id: GUID() },
Collect(colToastDeck, { ID: id, State: "busy", Title: "Saving order #1042...", Message: "Writing to SharePoint", Expires: DateAdd(Now(), 1, TimeUnit.Days) });
IfError(
Patch(Orders, ThisItem, { Status: "Shipped" }),
UpdateIf(colToastDeck, ID = id, { State: "err", Title: "Order #1042 not saved", Message: FirstError.Message }),
UpdateIf(colToastDeck, ID = id, { State: "ok", Title: "Order #1042 saved", Message: "Just now", Expires: DateAdd(Now(), 6, TimeUnit.Seconds) })
)
)
The Notes of each save toast show its formula too.
Good to know
- The action button only closes the toast.
btnToastAction,btnTabToastActionandbtnMorphToastActionhave a comment in OnSelect where your Undo or Reload goes. On Tab Toast and Morph Toast one button serves both results, so test the state there, for exampleIf(varTabToastState = "err", ...). - On a save toast, a saved result closes after the time from Settings and an error stays until the user closes it. On Morph Toast only the action button closes an error, and on Tab Toast the action or the Dismiss button does, so leave one switched on. On Toast Deck the close X only shows after a tap has fanned the deck out, and
btnDeckToastClear(Clear all) empties the deck. - The kind of a basic toast is written into the YAML as a fixed icon and fixed colors; no variable switches it while the app runs. Use a save toast when one toast has to show both success and error.
- Toast Notification closes itself through the timer
ToastAutoHidewhile Close by itself is on, and Notification with Timer throughTimedNoticeAutoHide. Simple Notification and Status Notifications stay until the X is clicked. - The demo button of a save toast pretends to save for 1.4 seconds, then ends the way you chose under Demo save ends with. Its timer, such as
TabToastDemo, only starts for the demo button. - In Modern YAML the icons are images, so the close X
icoToastCloseis namedimgToastClose. The variables and formulas are the same in both control sets. - A toast has to draw in front of your other controls. If a gallery covers it, select it in Power Apps Studio and choose Reorder, then Bring to front.
Related
Open the family in the library at Toast. Related guides: Modals and Badge.