Skip to content

ExpandableSectionToggle - allow adding aria-label to internal button #12028

@dgdavid

Description

@dgdavid

Is this a new component or an extension of an existing one?

Kind of extension to an existing one.

Describe the feature

When using a detached ExpandableSection, it would be beneficial to have the ability to pass an aria-label to the underlying element used by ExpandableSectionToggle. This would enhance accessibility in the following scenarios:

  • Icon-only toggles: when using only a custom icon (actually not possible out-of-the-box in current implementation, but we are hidden the default one with CSS :/), being able to set a specific aria-label would ensure that the toggle remains accessible.

  • Shortening accessibility text: when the toggle has verbose text to provide a larger clickable area (e.g., for better usability), an aria-label would allow a more concise accessible label to be provided, reducing redundancy without compromising accessibility.

While the second use case approach might be debatable and probably the right approach would be not using such a large text for the toggle , providing an aria-label option seems reasonable and could address a few corner cases for users requiring tailored accessibility.

Are there visuals for this feature? If applicable, please include examples for each state and for varying widths

No

Any other information?

Request actually applies to not detached version too. In fact, the code for producing both toggles are almost identical with the exception of onClick prop.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

PR Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions