Toaster

The <Toaster /> component is used to show toasts in your application

tsx
import { Toaster } from "@pheralb/toast";
 
<Toaster />;

Position

By default, the position is bottom-right. You can customize the position of the toasts by using the position prop of the Toaster component:

tsx

Theme

You can set the theme of the toasts using the theme prop, which accepts the values: light, dark, and system:

tsx

💡 If you want to configure the theme automatically, read Dark Mode guide.

MaxToasts

By default, the maximum number of toasts is set to 4. You can change this value using the maxToasts prop:

jsx
<Toaster maxToasts={8} />

API Reference

The <Toaster /> component accepts the following options:

PropertyDescriptionTypeRequired
themeTheme of the all toastsTheme (default: system): 'light', 'dark', or 'system'-
maxToastsMaximum number of toasts to displaynumber-
toastIconsReplace the default icons with custom iconsRecord<Variant, ReactNode>-
positionPosition of the toaster on the screenPosition (default: bottom-right): 'top-left', 'top-right', 'top-center', 'bottom-left', 'bottom-right' or 'bottom-center'-
toastOptionsOptions to customize all toasts.ToastOptions-