Skip to content

useDisclosure ​

Category
Utilities

Hook that allows you to open and close a modal

typescript
import { useDisclosure } from '@siberiacancode/reactuse';

Usage ​

typescript
const { opened, open, close, toggle } = useDisclosure();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
initialValueboolean-The initial value of the component
options.onOpen?() => void-The callback function to be invoked on open
options.onClose?() => void-The callback function to be invoked on close

Contributors ​

Source • Demo