Skip to content

useDisclosure ​

utilities
test coverage
Last changed: last month

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
initialValue?booleanfalseThe 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

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax

Released under the MIT License.