Temporary notifications with accessible ARIA roles and automatic dismissal. Use the useToast hook to show toasts throughout your application.
Click any button above to see a toast notification. Toasts automatically dismiss after 4.5 seconds.
import { useToast } from '@/components/ui/composites/toast-provider'
function MyComponent() {
const { addToast } = useToast()
const handleSuccess = () => {
addToast({
title: 'Success!',
description: 'Your action was completed.',
colorScheme: 'success',
position: 'top-center',
})
}
return <Button onClick={handleSuccess}>Show Toast</Button>
}Trigger each button to see how different color schemes and variants appear.
Light gradient background for low-priority confirmations.
Bold solid background to highlight important wins.
Soft warning tone when a recoverable issue occurs.
Hard stop background for critical errors.
Informational messages with subtle blue styling.
Warning messages with orange accent.
Primary brand color for important notices.
Toasts can be positioned at different locations on the screen. Each position has its own container.
Top Right
Default placement for confirmations and info banners.
CSS Classes:
top-4 right-4Top Center
Center-aligned alerts for dashboard headers or modals.
CSS Classes:
top-4 left-1/2 -translate-x-1/2Top Left
Great when the right side hosts other critical controls.
CSS Classes:
top-4 left-4Bottom Right
Often used for undo helpers or secondary confirmations.
CSS Classes:
bottom-4 right-4Bottom Center
Ideal for chat hooks or token tips above sticky footers.
CSS Classes:
bottom-4 left-1/2 -translate-x-1/2Bottom Left
Useful if the footer has primary actions on the right.
CSS Classes:
bottom-4 left-4Returns an object with the following methods:
addToast(payload) - Adds a new toast notificationremoveToast(id) - Removes a toast by IDtitle (required) - The toast title textdescription (optional) - Additional description textcolorScheme (optional) - One of: success, error, info, warning, primary, muted (default: success)variant (optional) - One of: subtle, solid (default: subtle, or solid for errors)position (optional) - One of: top-left, top-center, top-right, bottom-left, bottom-center, bottom-right (default: top-right)icon (optional) - Custom icon name (default: based on colorScheme)