react-popupkit
Version:
A lightweight and easy-to-use React component for creating functional popups without managing state or function. Just call the component, apply your styles, and enjoy optimized magical popups.
32 lines (31 loc) • 997 B
TypeScript
import React, { ReactNode } from 'react';
type TPopupProps = {
children: ReactNode;
isOpen?: boolean;
setIsOpen?: React.Dispatch<React.SetStateAction<boolean>>;
className?: string;
[x: string]: any;
};
type TPopupButtonProps = {
children: ReactNode | string;
onClick?: (e?: HTMLButtonElement) => void;
toggle?: boolean;
className?: string;
[x: string]: any;
};
type TPopupBody = {
children: ReactNode;
className?: string;
[x: string]: any;
};
type TTriggerCloseProps = {
children: ReactNode;
};
declare const Popup: {
({ children, isOpen, setIsOpen, ...args }: TPopupProps): React.JSX.Element;
Button: ({ children, onClick: customOnClick, toggle, ...args }: TPopupButtonProps) => React.JSX.Element;
Body: ({ children, ...args }: TPopupBody) => React.JSX.Element;
TriggerClose: ({ children }: TTriggerCloseProps) => React.JSX.Element;
};
export declare const useClosePopup: () => () => void | undefined;
export default Popup;