Problem Statement
Explain when to use toasts versus alerts, and how to place toasts on a page.
Explanation
Use toasts for brief, non-blocking notifications like 'Saved' or 'Copied'. They appear and disappear automatically. Use alerts when you want persistent messages that users can read or dismiss manually.
Place toasts in a fixed corner container and add role='status' with aria-live='polite' so screen readers announce them without interrupting focus.
Code Solution
SolutionRead Only
<div class='toast-container position-fixed top-0 end-0 p-3'> <div class='toast show' role='status' aria-live='polite'><div class='toast-body'>Saved</div></div> </div>
