react-fresh-toast
Version:
React notification made easy
17 lines (14 loc) • 500 B
TypeScript
type PositionType = "bottom-left" | "bottom-right" | "top-left" | "top-right" | "top-center";
interface ToastProps {
type: "success" | "info" | "warning" | "error";
message: string;
onClose?: () => void;
animation?: "fade" | "pop" | "slide";
duration?: number;
}
interface UseToastReturn {
ToastContainer: JSX.Element;
triggerToast: (toastProps: ToastProps) => void;
}
declare const useToast: (position?: PositionType) => UseToastReturn;
export { useToast as default };