UseDisclosure
Last updated: 3.0.0 (04/07/2024) | Added: 2.0.0
Last updated
Was this helpful?
Last updated: 3.0.0 (04/07/2024) | Added: 2.0.0
Last updated
Was this helpful?
useDisclosure
is a hook that allows the manipulation of a boolean
state. It is widely used internally to hide or show components such as the and .
opened
boolean
Whether the disclosure is open.
open
() => void
Open the disclosure.
close
() => void
Close the disclosure.
toggle
() => void
Toggle the disclosure.
update
(value: boolean) => void
Manually update the disclosure.
3.0.0: added the .toggle()
method to the return type.
2.0.0: added hook.