ValyroUI Русская версия

Toast

Pop-up notifications. Free, MIT · Overlays and notifications › Messages and status

Renders toasts created with toast(). Mount exactly one per app. Sonner-style stack: collapsed by default, expands on hover/focus, which also pauses timers. Toasts sit above modals, and pressing one does not dismiss the modal under it.

Installation

npx valyro-cli@latest add toast
npx shadcn@latest add https://valyro.xyz/r/toast.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Toaster, toast } from 'valyro-ui';

Props

PropTypeDefault
position'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right''bottom-right'Viewport corner or edge the stack sits at; new toasts enter from that edge. On phones (≤ 600px) it spans the width.
visibleToastsnumber3Toasts beyond this count wait (hidden, timers paused) behind the stack.
richColorsbooleanfalseTint success / error / warning / info toasts with their status color.
closeLabelstring'Close notification'Accessible name of each toast's close button.

Related components

Previous: Alert · Next: Notification Center · All Overlays and notifications