Skip to content

Commit 62e66e0

Browse files
authored
docs(toast): clarify toasts from overlays (#3432)
1 parent 21d2de3 commit 62e66e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/api/toast.md

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ While this is not a complete list, here are some guidelines to follow when using
208208

209209
* For toasts with long messages, consider adjusting the `duration` property to allow users enough time to read the content of the toast.
210210

211+
* If adding buttons to a toast, always provide alternative ways of completing the actions associated with each button. This ensures that even if the toast dismisses before a user can read it, they can still complete the actions shown in the toast.
212+
213+
* Avoid showing a toast with buttons from inside another overlay such as a [modal](./modal). Modals and other overlays implement [focus trapping](./modal#focus-trapping) that will prevent screen readers from moving focus to the toast to complete the actions. This may be confusing for users since the toast will still be announced by screen readers. This is true even if alternative ways of completing the actions associated with each button are implemented. Consider creating a [live region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) within the focus-trapped modal instead of using a toast.
214+
211215
## Interfaces
212216

213217
### ToastButton

0 commit comments

Comments
 (0)