useDisclosureState
Manages state for a disclosure widget. Tracks whether the disclosure is expanded, and provides methods to toggle this state.
useDisclosureState( (props: DisclosureProps )): DisclosureState
Properties
Name | Type | Description |
isExpanded | boolean | Whether the disclosure is currently expanded. |
Methods
Method | Description |
setExpanded( (isExpanded: boolean )): void | Sets whether the disclosure is expanded. |
expand(): void | Expand the disclosure. |
collapse(): void | Collapse the disclosure. |
toggle(): void | Toggles the disclosure's visibility. |
See the docs for useDisclosure in react-aria for an example of useDisclosureState
.