Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckboxControl, RadioControl, ToggleControl: Support accessible, flexible layouts #60799

Open
mirka opened this issue Apr 16, 2024 · 2 comments
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@mirka
Copy link
Member

mirka commented Apr 16, 2024

What problem does this address?

CheckboxControl, RadioControl, and ToggleControl do not properly support our layout needs, and developers are forced to roll their own solutions or override the component in fragile ways, which can result in slower iteration speeds and accessibility issues.

Examples of the problems we're encountering

CheckboxControl

RadioControl

ToggleControl

What is your proposed solution?

This can potentially be addressed in multiple ways, so we need to assess what is the best way forward. Possible approaches include:

  • Improve the documentation (e.g. Storybook examples) so that they show how to accessibly implement common custom layouts.
  • Moving to a more modular API based on subcomponents, taking inspiration from (or directly use) Ariakit components.
  • Keeping the current APIs, but also exporting more modular subcomponents like we do with BaseControl.VisualLabel. This must be coupled with clear usage guidance for accessibility.
@mirka mirka added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Apr 16, 2024
@ntsekouras
Copy link
Contributor

I'd avoid suggestion 1 and between the remaining two, I have a preference for suggestion 2. We've started doing it for more components and it's nice to have some a11y problems already solved by Ariakit.

@mirka
Copy link
Member Author

mirka commented Apr 17, 2024

I'd avoid suggestion 1

At least for CheckboxControl, the accessibility mishaps I've seen are mostly due to lack of awareness rather than deficiencies in component API, so we'd probably need to tackle the issue from the documentation angle as well, regardless of any improvements we can make to the actual API. I haven't looked too deeply into the RadioControl situation though.

@mirka mirka changed the title CheckboxControl, RadioControl: Support accessible, flexible layouts CheckboxControl, RadioControl, ToggleControl: Support accessible, flexible layouts Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants