|
| 1 | +# Disclosure Component Research |
| 2 | + |
| 3 | +## Inspiration: |
| 4 | + |
| 5 | +- ARIA Authoring Practices Guide (APG) |
| 6 | + |
| 7 | +## Key Points: |
| 8 | + |
| 9 | +A disclosure widget allows content to be shown or hidden, enhancing accessibility and user experience by managing content visibility. |
| 10 | + |
| 11 | +## Anatomy: |
| 12 | + |
| 13 | + <Collapsible> |
| 14 | + <CollapsibleTrigger /> |
| 15 | + <CollapsibleContent /> |
| 16 | + </Collapsible> |
| 17 | + |
| 18 | +## Features: |
| 19 | + |
| 20 | + - [ ] Show/Hide Content |
| 21 | + - [ ] Accessible to keyboard users |
| 22 | + - [ ] ARIA roles and properties for enhanced screen reader support |
| 23 | + - [ ] Optionally, support for dynamically loading the disclosed content |
| 24 | + |
| 25 | +## Keyboard Interactions: |
| 26 | + |
| 27 | + key: Enter |
| 28 | + description: Toggles the visibility of the disclosure content. |
| 29 | + |
| 30 | + key: Space |
| 31 | + description: Toggles the visibility of the disclosure content. |
| 32 | + |
| 33 | +## WAI-ARIA Roles, States, and Properties: |
| 34 | + |
| 35 | + - The button controlling the disclosure has `role="button"` and `aria-expanded` attribute which indicates the visibility state of the content. |
| 36 | + - Optionally, `aria-controls` can be used on the button to reference the id of the content container. |
| 37 | + |
| 38 | +## Use Cases: |
| 39 | + |
| 40 | +- FAQ sections |
| 41 | +- Navigation menus with collapsible sections |
| 42 | +- Hiding and revealing more detailed content |
| 43 | + |
| 44 | +## Accessibility Considerations: |
| 45 | + |
| 46 | +- Ensure that the state (expanded or collapsed) is clearly communicated to assistive technologies. |
| 47 | +- Provide visual indicators (like arrows) that hint at the action of the button. |
| 48 | +- Consider dynamically loading content as an enhancement, not a requirement, for the functionality to work. |
| 49 | + |
| 50 | +## Downsides: |
| 51 | + |
| 52 | +- Requires careful implementation to ensure accessibility standards are met. |
| 53 | +- Dynamic content loading can introduce complexity in maintaining state and accessibility. |
0 commit comments