Components
Loading preview...
Here is Toast component
@ayushmxxn
npx shadcn@latest add https://21st.dev/r/ayushmxxn/toast-1'use client';
import { ToastProvider, useToast } from '@/components/ui/toast-1';
function PageContent() {
const { showToast } = useToast();
return (
<div className="flex flex-col justify-center items-center h-screen space-y-4">
<button
onClick={() => showToast('Operation successful.', 'success', 'top-right')}
className="bg-neutral-100 hover:bg-opacity-90 text-black font-medium py-2 px-4 rounded-full"
>
Show Success Toast
</button>
<button
onClick={() => showToast('There was an error.', 'error', 'bottom-left')}
className="bg-neutral-100 hover:bg-opacity-90 text-black font-medium py-2 px-4 rounded-full"
>
Show Error Toast
</button>
<button
onClick={() => showToast('Check this warning.', 'warning', 'top-left')}
className="bg-neutral-100 hover:bg-opacity-90 text-black font-medium py-2 px-4 rounded-full"
>
Show Warning Toast
</button>
<button
onClick={() => showToast('Here is some info.', 'info', 'bottom-right')}
className="bg-neutral-100 hover:bg-opacity-90 text-black font-medium py-2 px-4 rounded-full"
>
Show Info Toast
</button>
</div>
);
}
export default function Page() {
return (
<ToastProvider>
<PageContent />
</ToastProvider>
);
}