Toast
A short message that appears and leaves on its own.
How to use it
Copy any example below and paste it in- From markup
data-toast="Saved."with an optionaldata-toast-variant.- From code
Brutalism.toast('Saved.', { variant: 'success' }).- Announced
- The stack is a
role="status"live region, so a toast is read without stealing focus. Hovering pauses the countdown.
The four variants
Click to fire one.
<div class="flex flex-wrap gap-3">
<button type="button" class="btn" data-toast="Nothing to report." data-toast-variant="info">Info</button>
<button type="button" class="btn" data-toast="Changes saved." data-toast-variant="success">Success</button>
<button type="button" class="btn" data-toast="Two seats left on this plan." data-toast-variant="warning">Warning</button>
<button type="button" class="btn" data-toast="The card was declined." data-toast-variant="danger">Danger</button>
</div>