Toast
A customizable and responsive toast notification system.
Loading...
Installation
npx shadcn@latest add @scrollxui/toast Usage
//First, wrap your application with the ToastProvider:
import { ToastProvider } from '@/components/ui/toast';
function App() {
return (
<ToastProvider>
<YourApp />
</ToastProvider>
);
}import { useToast } from '@/components/ui/toast';
return function MyComponent() {
const { toast } = useToast();
const showToast = () => {
toast({
title: 'Success!',
description: 'Your action was completed successfully.',
variant: 'success',
});
};
};Examples
Default
Loading...
Warning
Loading...
Error
Loading...
Delete
Loading...
Info
Loading...
Success
Loading...
With Action
Loading...
Persistent
Loading...
Promise
Loading...
Rich Content
Loading...
Custom Duration
Loading...
Bulk Actions
Loading...
API Reference
toast
Triggers a toast notification.