UNPKG

g-notification

Version:

A flexible and customizable React notification/toast component with TypeScript support

40 lines 1.32 kB
import React from "react"; import type { ReactNode } from "react"; export type Toast = { id: number; icon?: React.ReactNode; title?: string; content: string; duration?: number; type?: "success" | "danger" | "warning" | "info" | "custom"; style?: React.CSSProperties; cssAnimation?: { animationName: string; animationDuration?: string; keyframes: string; }; closeButton?: boolean; closeButtonContent?: React.ReactNode; onClick?: () => void; onPress?: () => void; link?: string; persistent?: boolean; customRender?: (props: { close: () => void; }) => React.ReactNode; _pressTimeout?: ReturnType<typeof setTimeout>; }; type GToastFn = (toast: Omit<Toast, "id">) => void; interface GNotificationProviderProps { children: ReactNode; position?: "top-right" | "top-left" | "bottom-right" | "bottom-left"; maxVisibleNotification?: number; zIndex?: number; progressBar?: boolean; } export declare const GNotificationProvider: ({ children, position, maxVisibleNotification, zIndex, progressBar }: GNotificationProviderProps) => import("react/jsx-runtime").JSX.Element; export declare const useGNotification: () => { g_toast: GToastFn; }; export {}; //# sourceMappingURL=GNotificationProvider.d.ts.map