You can allow users to perform a single associated action via the action prop. When the action is performed, the toast is automatically removed from the screen.
Toast actions are not available to screen readers. To maintain accessibility, please ensure that these actions are either non-essential or available elsewhere in your application.
A toast message can be dismissed via the close button or automatically after 10 seconds. The aria-label for the close button can be customised by providing a closeLabel prop.
You can assign a key to each toast which is used to guarantee that only a single toast with a given key is visible at once. This is particularly useful for reducing visual noise when your application has the potential to generate a lot of toasts.