Toast

A Toast component is a transient notification that appears on the screen to provide feedback or information to users without interrupting their workflow. Typically displayed at the top or bottom of the screen, toasts are brief messages that automatically disappear after a short duration. They are commonly used to inform users about actions such as successful submissions, updates, or alerts, enhancing the overall user experience with minimal disruption.
# Demo
# Attributes
NameTypeDefaultDetails
descriptionstringRequiredYou can pass description to show toast.
titlestring' 'You can pass title to show toast with title.
# Usage
import { useToast } from 'nayan'; const Toast = () => { const toast = useToast(); return ( <div> <NButton onClick={() => toast('Simple Toaster!')}> Show Simple Toast </NButton> <NButton className="ml-5" onClick={() => toast('Toaster Description!', 'Toaster Title')}> Show Toast with Title </NButton> </div> ); }; export default Toast;