Components / Feedback
Toast
A fixed stack of transient notifications.
Saved
Your changes have been saved.
Upload failed
The file is larger than 10 MB.
<div style="display: flex; flex-direction: column; gap: 0.5rem; max-width: 22rem">
<div class="toast" role="status">
<section>
<p data-slot="title">Saved</p>
<p data-slot="description">Your changes have been saved.</p>
</section>
<button type="button" class="btn" data-variant="ghost" data-size="icon-xs" data-slot="close" aria-label="Dismiss">×</button>
</div>
<div class="toast" data-variant="destructive" role="alert">
<section>
<p data-slot="title">Upload failed</p>
<p data-slot="description">The file is larger than 10 MB.</p>
</section>
<button type="button" class="btn" data-variant="ghost" data-size="icon-xs" data-slot="close" aria-label="Dismiss">×</button>
</div>
</div>Installation
pnpm dlx loseta add toastnpx loseta add toastAccessibility and behavior
- Wrap toasts in .toaster for fixed positioning. Items use role="status" or role="alert"; timing and dismissal are consumer JavaScript. Sonner is a compatibility note, not a registry item; keep the toast markup and add Sonner in consumer code when you need its queue.
Files
components/toast.cssbasestyles/nova/toast.cssstyleInstall contract
The CLI writes the base file under components/, the visual file for the selected style under styles/<name>/, and any primitive dependency underprimitives/. The generated index.css imports them in the right layer order.