Details about personal information here. This section can also be controlled programmatically.
Multiple Expanded
By default, only one disclosure will be open at a time. To allow multiple disclosures to expand, use the allowsMultipleExpanded prop.
Disabled
A DisclosureGroup can be disabled using the isDisabled prop.
Details about system requirements here.
Details about personal information here.
Interactive Elements
You can add interactive elements adjacent to the disclosure heading.
Details about system requirements here. Notice the additional button in the header.
Details about personal information here. Each disclosure can have its own interactive elements.
Props
DisclosureGroup
Name | Type | Default | Description |
---|---|---|---|
defaultExpandedKeys | Iterable<Key> | — | The initial expanded keys in the collection (uncontrolled). |
expandedKeys | Iterable<Key> | — | The expanded keys in the collection (controlled). |
allowsMultipleExpanded | boolean | false | Whether multiple items can be expanded at the same time. |
isDisabled | boolean | — | Whether the disclosure group is disabled. |
onExpandedChange | (keys: Set<Key>) => void | — | Handler that is called when the expanded items change. |
Disclosure
Name | Type | Default | Description |
---|---|---|---|
id | Key | — | A unique identifier for the disclosure item. |
isExpanded | boolean | — | Whether the disclosure is expanded (controlled). |
defaultExpanded | boolean | — | Whether the disclosure is expanded by default (uncontrolled). |
isDisabled | boolean | — | Whether the disclosure is disabled. |
Styling
React Aria components can be styled in many ways, including using CSS classes, inline styles, utility classes (e.g. Tailwind), CSS-in-JS (e.g. Styled Components), etc.
Component States
DisclosureGroup States
data-disabled
- Whether the disclosure group is disableddata-orientation
- The orientation of the disclosure group
Disclosure States
data-expanded
- Whether the disclosure is expandeddata-disabled
- Whether the disclosure is disableddata-focus-visible
- Whether the disclosure is keyboard focused
Feedback
Help us improve this component by providing feedback, asking questions on GitHub, or updating this file.