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

Experimental Design - improvements to va-button disabled variation #2792

Open
Tracked by #81368
andaleliz opened this issue May 1, 2024 · 1 comment
Open
Tracked by #81368
Labels
component-new Proposed new component experimental_design Design System experimental design requests pattern-update Change to an existing pattern

Comments

@andaleliz
Copy link
Contributor

What

I'm proposing one improvement and one addition to va-button.

  1. Increase the contrast of the background color for the current disabled state to improve accessibility. The current background color doesn't have sufficient contrast ratio against background colors on va.gov (modal variations + standard white page background)
  2. Add a loading variation to va-button to improve consistency across VA.gov and have a variation and guidelines available for teams

Purpose

  1. If we think about "accessibility beyond compliance", we can do better than the current background color and make sure it stands out clearly against all background colors on va.gov.
  2. A loading variation would help users understand when an action they initiated is in progress, and provide context to why the button has entered a disabled state.

Usage

  1. Disabled variation is already part of the design system. This variation is used on VA.gov to communicate loading states, and possibly for other reasons. I didn't fully audit the site to see where disabled buttons may be used, but there are 3 examples here.
  2. Loading buttons/states are already used on VA.gov to communicate when a user-initiated action is in progress. Here are 5 examples of different approaches in use on VA.gov today.

Behavior

  1. Nothing would change about the behavior of the disabled button.
  2. In a loading state, the button variation would change from primary or secondary, to loading; the color of the button would change and an animated loading icon would appear.

Examples

Accessibility

  • Admittedly, I haven't dug into the code enough to know about how the disabled button variation, or other loading buttons are coded today, but this article may have some relevant ideas for improvement under the hood, if they are needed

Guidance

I don't think any changes to disabled button guidance would be needed. For the loading variation, I would say:

  • Consider using this when the user has interacted with a button to perform an action, like submitting a form.
  • The button label should reflect the process initiated by the user in plain language

Other things we considered

  • We considered replacing the buttons with the loading component, as done on the 10-10ez form, but that option introduces more movement to the page on desktop since the height of the component is greater than buttons, and the center alignment is in a totally different place. It also creates cognitive disconnect since the elements get completely swapped out.
    • We thought about creating a shorter variation of the loading component, possibly where the icon is on the left so it could more easily replace left aligned buttons. We didn't pursue this because loading buttons are a very common pattern on modern websites (and in other design systems, e.g. Adobe) that Veterans are likely to be familiar with, and that seems like a better solution here.
  • We also considered replacing whatever form a person interacted with with a skeleton UI and using the loading component on top (overly complicated, potentially challenging for people w/ cognitive considerations or magnification, especially on a long form)
  • We considered using some kind of progress bar in place of buttons (fancy for no reason, not accessible, and overkill for what is needed)

Code (optional)

Next steps

If your request is approved, you can add your component or pattern to the system. If you have any questions on how to add your component or pattern to the system, please reach out to the Design System Team at #platform-design-system.

@caw310
Copy link
Contributor

caw310 commented Jun 3, 2024

@andaleliz This is on the agenda for the DSC meeting on June 6 at 11:05AM ET. I will add you to the invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-new Proposed new component experimental_design Design System experimental design requests pattern-update Change to an existing pattern
Projects
None yet
Development

No branches or pull requests

2 participants