The Toast component is used to display brief messages to the user, typically for notifications or alerts. The toast messages can be focused with the keyboard with the `f6` key.
## Component Structure
```rust
// The Toast provider provides the toast context to its children and handler rendering any toasts that are sent.
ToastProvider {
// Any child component can consume the toast context and send a toast to be rendered.
button {
onclick: |event: MouseEvent| {
// Consume the toast context to send a toast.
let toast_api = consume_toast();
toast_api
.error(
"Critical Error".to_string(),
ToastOptions::new()
.description("Some info you need")
.duration(Duration::from_secs(60))
.permanent(false),
);
},
"Show Toast"
}
}
```