dequelabs / dequelabs/cauldron
Allow <Button> to collapse down to an <IconButton>
- Dominant language
- TypeScript
- Stars
- 127
- Forks
- 31
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 8
Description
There's instances where a `` needs to collapse down to an `` due to responsive design constraints. An author can do this today, but this presents issues when a either Button currently has focus, the author needs to also maintain focus between the two elements since one element gets mounted to the dom.
To simplify focus management, we could allow for the author to continue using `` but allow for a `collapsed` property that would still maintain the mounted button in the dom, while swapping out the styles for `IconButton`:
* The button's content would be rendered inside of an `` element to maintain the existing button's accessible name
* A tooltip is added to provide a visual indication of the accessible name upon focus
Remaining Questions:
- How do we enforce the usage of an icon? The uncollapsed button may or may not have an icon as a child.
Contributor guide
Assessment
This issue has not been assessed yet.