🚀ReacUI is currently in Beta. We're actively improving it! ❣️
Toast
Notifications that appear temporarily to provide feedback to users
Information toast
This is additional information
Installation
The Toast component is part of the ReacUI library. Install the package to use it in your project.
Import
Import the Toast component into your React component.
Toast Variants
ReacUI toasts come in several variants to accommodate different types of notifications.
Information toast
Success toast
Warning toast
Danger toast
Toast Positions
Toasts can be positioned in different parts of the screen.
Top Right (Default)
Bottom Left
Custom Duration
You can customize how long a toast remains visible before auto-dismissing.
Short duration (2 seconds)
Persistent toast (never auto-dismiss)
With Actions
Toasts can include action buttons for additional functionality.
File uploaded successfully
API Reference
The following props are available for the Toast component.
| Prop | Type | Default | Description |
|---|---|---|---|
| message | string | - | Primary message to display in the toast |
| description | string | '' | Additional description text |
| variant | string | 'info' | Toast style variant: 'info', 'success', 'warning', or 'danger' |
| position | string | 'top-right' | Position on the screen: 'top-right', 'top-left', 'bottom-right', 'bottom-left', 'top-center', 'bottom-center' |
| duration | number | 5000 | Time in milliseconds before auto-dismissing. Set to 0 to disable auto-dismiss. |
| dismissible | boolean | true | Whether the toast can be manually dismissed |
| icon | ReactNode | - | Custom icon to display. Set to null to hide icon completely. |
| action | ReactNode | null | Action button or content to display in the toast |
| className | string | '' | Additional CSS classes to apply |
| onDismiss | function | - | Callback function invoked when the toast is dismissed |