Toast Notifications
Display toast notifications for user feedback
HooksUI
Live Demo
Source Code
'use client';
import { useToast } from '@sofondo/react';
export default function MyComponent() {
const { addToast } = useToast();
const handleSuccess = () => {
addToast('Operation completed successfully!', 'success');
};
const handleError = () => {
addToast('Something went wrong!', 'error');
};
const handleInfo = () => {
addToast('Here is some information', 'info');
};
return (
<div>
<button onClick={handleSuccess}>Success Toast</button>
<button onClick={handleError}>Error Toast</button>
<button onClick={handleInfo}>Info Toast</button>
</div>
);
}