Disclosure
a primitive for creating a Disclosure component.
- View ARIA pattern W3C
- View source code GitHub
- View code coverage v8-coverage
- View type documentation typedoc
Anatomy
API Reference
Parameters [DisclosureArguments]
Name | Type | Default | Description |
---|---|---|---|
defaultVisible | boolean | false | Whether the Disclosure is open by default (uncontrolled). |
id | string | - | Custom unique identifier of the disclosure content element. |
isButtonElement | boolean | true | Whether the disclosure toggle is a button element, default to true. Set this to false if you want to use a different element than a button. |
isVisible | boolean | - | Whether the Disclosure is open by default (controlled). |
onVisibilityChange | (isOpen: boolean) => void | - | Handler that is called when the Disclosure visibility state changes. |
Return value [AriaDisclosure]
Name | Type | Description |
---|---|---|
contentProps * | JSX.HTMLAttributes<any> | The toggle button properties. |
state * | { isVisible: boolean } | The current state of the disclosure. |
toggleProps * | JSX.HTMLAttributes<any> | The content element properties. |