Power Apps · canvas componentDialogs and feedback✓ Tested in StudioMIT License
Toast
A coloured message bar for success, info, warning and error, shown from anywhere with one Show action. It closes itself, queues messages so none are lost, takes an Undo or View button, and comes in light or dark.
- Name in Studio
- lcsToast
- Version
- 0.4.0
- Properties
- 8 inputs · 3 outputs · 1 input function · 2 events · 2 actions
Variations
As it is when you paste it, with every input at its default.
Formulas on this screen
Set the same ones in Studio to try it the same way; there, each Notify shows its event in a banner, which this preview leaves out so nothing covers the component. The instance names are the ones Studio gives the first copy on a screen.
Button1.OnSelect = lcsToast_1.Show("Request saved.", "Success")
Button2.OnSelect = lcsToast_1.Show("Couldn't save. Try again.", "Error")
Button3.OnSelect = lcsToast_1.Show("Sync runs every hour.", "Info")
lcsToast_1.OnAction = Notify(lcsToast_1.ActionText & " selected")
lcsToast_1.OnDismiss = Notify("Message closed")
A web replica that behaves as the component does in Power Apps. In Studio it uses Microsoft's controls, which can look slightly different.
Add it in five steps
- In Power Apps Studio, open Settings > Updates and check that Modern controls and themes and Enhanced component properties are on.
- Open the Components tab in the tree view and select New component.
- Select an empty part of Studio, so the new component isn't selected.
- Copy the YAML on this page and press Ctrl+V.
lcsToastappears with all its properties. - On a screen, insert it from Insert > Custom >
lcsToast.
What it needs
- No premium licence: standard controls, no connectors
- Modern controls and themes: on
- Enhanced component properties: on
- Tested in Power Apps Studio 3.26094.9 on November 2, 2026
- Version 0.4.0
Properties (16)
Read from the component's own YAML, so they always match what you paste.
| Property | Kind | Type | Default |
|---|---|---|---|
DefaultOpenShows a toast with DefaultMessage from the start, so you see it while you design. It stays until it's closed. Set it to false when your app calls Show(). | Input | Boolean | true |
DefaultMessageWhat the toast says while DefaultOpen shows it, as a Success message, before Show() gives it one. | Input | Text | "Your changes are saved." |
ActionTextText for an optional button on the toast, such as Undo or View. Leave empty for none. | Input | Text | "" |
ToastWidthThe toast's width in pixels. It never gets wider than the component. | Input | Number | 420 |
DurationSeconds before the toast closes itself. 0 keeps it until the user closes it. With an action button, give people at least 10. | Input | Number | 6 |
AccentColorYour brand colour, used for the border and tint of Info messages. | Input | Color | RGBA(15, 108, 189, 1) |
ThemeLight, or Dark for a dark screen. | Input | Text | "Light" |
MotionDraws each message's symbol as a picture that animates once as the message appears: the check and cross draw themselves, the ! wobbles, the i rises. None plays for people who've asked their device for reduced motion. | Input | Boolean | true |
| Property | Kind | Type | Default |
|---|---|---|---|
QueueCountHow many messages are waiting behind the one showing. | Output | Number | — |
IsOpenTrue while the toast is showing. | Output | Boolean | — |
CurrentKindThe kind of the toast showing now: Success, Info, Warning or Error. | Output | Text | — |
| Property | Kind | Type | Default |
|---|---|---|---|
FormatMessage(Message, Kind)Lets your app change how messages read, such as adding a prefix. Receives the message and its kind.
| InputFunction | Text | Message |
| Property | Kind | Type | Default |
|---|---|---|---|
OnAction()Runs in the app when the user selects the toast's button. Then the next queued message shows, or the toast closes. | Event | — | false |
OnDismiss()Runs in the app when the user closes the toast. Then the next queued message shows, if there is one. | Event | — | false |
| Property | Kind | Type | Default |
|---|---|---|---|
Show(Message, Kind)Shows a message. Kind is Success, Info, Warning or Error; anything else shows as Info.
| Action | — | — |
Hide()Closes the toast and drops any queued messages, without running OnDismiss. | Action | — | — |
Guide
Use lcsToast to confirm what just happened ("Request saved"), or to warn about something the user should know, without stopping them. Compared with Notify, it:
- sits where you put it and looks like the rest of your app, light or dark, with your brand colour on Info messages;
- closes itself after
Durationseconds (6 by default; 0 keeps it until it's closed); - queues messages that arrive while one shows, so a quick second
Showdoesn't wipe out the first. The bar says how many more are waiting, andQueueCounttells your app; - can carry a button, such as Undo or View, with an OnAction event;
- tells your app its state (
IsOpen,CurrentKind); - lets one formula (
FormatMessage) shape every message.
Put it near the top of the screen, last in the tree view so it's on top, and name it tstMain. It shows a sample message from the start (DefaultOpen and DefaultMessage), so you can see it while you design. Once your app calls Show(), set DefaultOpen to false.
Show a message from anywhere:
// btnSave.OnSelect
Patch(Requests, Defaults(Requests), { Title: txtTitle.Text });
tstMain.Show("Request saved.", "Success")
The four kinds:
tstMain.Show("Saved.", "Success");
tstMain.Show("Sync runs every hour.", "Info");
tstMain.Show("You're offline. Changes will sync later.", "Warning");
tstMain.Show("Couldn't save. Try again.", "Error")
Offer Undo:
// tstMain.ActionText
"Undo"
// tstMain.OnAction
Remove(Requests, locLastSaved)
Keep a message until it's closed, such as one with an action people need time for:
// tstMain.Duration
0
Show errors from IfError:
IfError(
Patch(Requests, Defaults(Requests), { Title: txtTitle.Text }),
tstMain.Show("Couldn't save: " & FirstError.Message, "Error")
)
Nothing changes: the toast holds no data. Errors from Dataverse, such as a required column left empty, reach IfError like any other, and FirstError.Message carries Dataverse's own words into the toast, as in Use it.
- Each kind has its own symbol (✓, i, !, ✕) as well as its colour, so it doesn't rely on colour alone. Text colours meet 4.5:1 contrast on their backgrounds.
- The close button is labelled "Close message" for screen readers.
- With
Motionon (the default), the symbol is a small picture that animates once as each message appears: the ✓ and ✕ draw themselves, the ! wobbles and the i rises, in under a second. None plays for people who've asked their device for reduced motion;Motionset to false puts the symbol back in the text, as in 0.2.0. - Messages with a button need time to reach it: set
Durationto 10 or more, or 0, wheneverActionTextis set (WCAG 2.2.1, timing adjustable). The variations do.
- It closes itself with a timer, and Power Apps Studio runs timers only in preview (F5). In the published app it always runs.
- The queue lives inside the component, so each copy of it on a screen has its own.
Hide()closes the toast and empties its queue. - Screen readers don't announce it automatically. For an important error, also move the user's attention to the field at fault.
- Keep messages to one short sentence; long text wraps within the bar's height.
- 0.4.0:
DefaultOpenandDefaultMessage: a pasted toast shows a sample message, so it's never a blank bar while you design. Turn it off when your app callsShow(). - 0.3.0: motion: each message's symbol draws itself in as the message appears (skipped for reduced motion); a
Motioninput turns it off. WithMotionoff, it's exactly 0.2.0. - 0.2.0:
Duration(closes itself), a queue withQueueCount,AccentColorfor Info messages, andTheme. - 0.1.0: first version, for testing in Power Apps Studio.
Did it work for you?
No ratings yet.Nobody has said it worked in their app yet.
Sign in to rate it or to say it worked in your app.
Comments
No comments yet. Share how you used it, or ask something.
Sign in to comment or reply. Comments show under a display name you choose, never your email.