react-floatify
Version:
A lightweight, customizable toast notification library for React.
36 lines • 1.24 kB
TypeScript
import React, { type ReactNode } from "react";
import "./Toasty.scss";
export type ToastType = "default" | "success" | "error" | "warning";
export type Position = "top left" | "top right" | "bottom left" | "bottom right" | "top center" | "bottom center";
export type ToastVariant = "regular" | "outlined" | "contained";
export type ToastSpacing = "small" | "regular" | "large";
export type ToastSlideFrom = "left" | "top" | "right" | "bottom";
export interface ToastOptions {
type?: ToastType;
variant?: ToastVariant;
spacing?: ToastSpacing;
duration?: number;
disableAnimation?: boolean;
showProgress?: boolean;
showIcon?: boolean;
slideFrom?: ToastSlideFrom;
fontSize?: string | number;
iconSize?: number;
elevation?: number;
sx?: React.CSSProperties;
}
export interface Toast extends ToastOptions {
id: number;
message: string;
}
interface ToastContextProps {
addToast: (message: string, options?: ToastOptions) => void;
}
export declare const useToast: () => ToastContextProps;
interface ToastProviderProps {
children: ReactNode;
position?: Position;
}
export declare const ToastProvider: React.FC<ToastProviderProps>;
export {};
//# sourceMappingURL=ToastContext.d.ts.map