UNPKG

645 BTypeScriptView Raw
1export interface UseDisclosureProps {
2 open?: boolean;
3 defaultOpen?: boolean;
4 onClose?(): void;
5 onOpen?(): void;
6 id?: string;
7}
8/**
9 * `useDisclosure` is a custom hook used to help handle common open, close, or toggle scenarios.
10 * It can be used to control feedback component such as `Modal`, `AlertDialog`, `Drawer`, etc.
11 *
12 * @see Docs https://chakra-ui.com/docs/hooks/use-disclosure
13 */
14export declare function useDisclosure(props?: UseDisclosureProps): {
15 open: boolean;
16 onOpen: () => void;
17 onClose: () => void;
18 onToggle: () => void;
19};
20export type UseDisclosureReturn = ReturnType<typeof useDisclosure>;