@jay-js/ui
Version:
A library of UI components for Jay JS with Tailwind CSS and daisyUI.
34 lines (33 loc) • 864 B
TypeScript
/**
* Configuration options for the useModal hook
*/ type TUseModal = {
/**
* ID of the modal element to control
*/ modalId?: string;
/**
* Callback function triggered when modal is closed
*/ onClose?: () => void;
/**
* Callback function triggered when modal is opened
*/ onOpen?: () => void;
};
/**
* Interface for modal control methods
*/ export type TModalControls = {
/**
* Opens the modal
*/ open: () => void;
/**
* Closes the modal
*/ close: () => void;
/**
* Toggles the modal between open and closed states
*/ toggle: () => void;
};
/**
* A hook to control modal component functionality
*
* @param props - Configuration options for the modal
* @returns Object with methods to open, close, or toggle the modal
*/ export declare function useModal({ ...props }: TUseModal): TModalControls;
export { };