Component proposal: Tabs #5765
Replies: 18 comments 1 reply
-
Hi Mazen, Miguel, and Tanner, Thank you so much for contributing this Tabs component proposal to the design system. This is thoughtful and thorough work. We discussed this component during a team meeting, and had a few follow-up questions. Specifically, we want to work with you to understand the guidance aspect to this component as much as the technical side. We try to take a guidance-driven approach to component development, so let's take a step back and try to answer some of the fundamental questions about tabs from a guidance perspective:
As our team has learned with the Accordion component, there is a usability cost when a component hides content from the user. For instance, as with Accordion, a search engine result might point to content that's hidden in a tab and then isn't easily findable in an in-page search. In general, hiding content behind an interaction can add complexity. Complexity has a cost for all users, particularly those with physical or cognitive disabilities. It's important for us to understand how and why to use tabs, and how and when the benefits of using tabs outweigh these costs. We’re looking forward to hearing your thoughts on these questions. Thanks for helping us think through the guidance! |
Beta Was this translation helpful? Give feedback.
-
Hello Bonnie, Thank you for your response. We're happy to answer the following questions with you and the team, and welcome any further discussion or call to clarify the usage and guidance of the tabs component.
_ Building accessible experiences is the top priority of our team. The decision to develop a tabs component that met the needs of our customers outweighed the complexities that would be introduced to the experience. We leaned on our research to address these complexities. Specifically, for people living with cognitive or physical disabilities who will interact with the tabs component. JAWS and NVDA users find it helpful if all expandable components like accordions and tabs announce their element type (with descriptive naming conventions that allude to the content nested inside of them) to save confusion and enable the element to be predictable, and understood. While content nested within tabs can be found in most search engine results, finding this content within a page using keyboard find functionality can prove difficult for some users. This complexity can be alleviated with an in-page search present on pages with tabs that users can use to search for content that may be behind components like an ‘accordion’ or ‘tab’. Furthermore, we recommend (as shown in our guidance for usage) to ensure tab labels allude to the content nested within (much like an ‘Accordion’), which will help fill a usability gap that may come along with users visiting a page with tabs and any other component that nests content. |
Beta Was this translation helpful? Give feedback.
-
I'd love to have a Tabs component. I do not know how well that ARIA example is being tested or maintained. Usually the W3C is great, but updates are hard for everyone. I think that the https://design-system.service.gov.uk/components/tabs/ model is a good one to start with. Just not sure how it differs from what you've proposed. |
Beta Was this translation helpful? Give feedback.
-
@tannerbachelor thanks to you and your team for providing those answers! Sorry if I missed this, but I'm curious.
|
Beta Was this translation helpful? Give feedback.
-
We recognize the trade-off. Using semantic HTML provides predictable use for many users, and can tell them what is in the list – but has inconsistencies when being able to scroll horizontally. We can foresee a tabs component with a horizontal scroll tab list with a more predictable semantic markup to close the gap on the accessibility trade-off while addressing the needs for all of our users. |
Beta Was this translation helpful? Give feedback.
-
@tannerbachelor WCAG 2.0, 2.1 or 2.2? |
Beta Was this translation helpful? Give feedback.
-
WCAG 2.1 |
Beta Was this translation helpful? Give feedback.
-
Hey @tannerbachelor, we're using this proposal as a method for testing and improving our contribution guidelines. This is a goal for the next few months. Apologies if it's slow, but we want to make sure we're asking the right questions and this component meets all the requirements. We're going to carefully review the responses between the team and check against existing internal process docs. I'll update here as soon as I have more information. |
Beta Was this translation helpful? Give feedback.
-
Hello @mejiaj, just checking in for an update in regards to the status/ progress of the Tabs component implementation. Any information would be helpful for myself and the team. Thank you! |
Beta Was this translation helpful? Give feedback.
-
@tannerbachelor we're doing research and working on refining a component acceptance framework. uswds/uswds-team#240 I don't have any updates specific to tabs at the moment, sorry. |
Beta Was this translation helpful? Give feedback.
-
Thanks, James. I'll keep an eye out for updates on the framework. I'll also note: we've made additional accessibility enhancements that are reflected in the original demo environment we've provided in the proposal. Update 4/7/2023: Our demo environment featuring the tabs component included in this proposal now reflects all accessibility enhancements and has been independently certified as WCAG 2.1 AA conforming via LevelAccess. |
Beta Was this translation helpful? Give feedback.
-
Our demo environment featuring the tab component in this proposal now reflects all accessibility enhancements and has been independently certified as WCAG 2.1 AA conforming via LevelAccess. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for letting us know @tannerbachelor ! We'll have updates for you from our team soon. |
Beta Was this translation helpful? Give feedback.
-
Hi Bonnie, hope all is well. Is there any update from the team on the status of this request? |
Beta Was this translation helpful? Give feedback.
-
Hi @tannerbachelor! Yes, I'm happy to say we have an update. Thank you so much for your patience. As you know, we're a small crew and we found that we didn't yet have a process by which to fairly and transparently evaluate a contribution like this. We've worked internally to develop such a process, and would like to begin collaborating more closely with you soon. A teammate of mine will be reaching out within the next couple of weeks with further information. In the meantime, this Thursday 8/17 we are discussing our roadmap, vision, and to some extent our evaluation process for the coming fiscal year in the USWDS Monthly Call. Please join us if you are able, and we'll reach out again soon. |
Beta Was this translation helpful? Give feedback.
-
Thank you! We're looking forward to it. |
Beta Was this translation helpful? Give feedback.
-
I'm at the Office of Homeland Security Statistics and we're going to be moving a lot of our pdf report content into webpages (to comply with OMB M-23-22 and OMB M-24-08). All of the site hierarchy (primary and left nav) is used to get to the reports, so that leaves in-page navigation for navigating the reports. Tabs would allow an extra level of hierarchy to chunk the information in the reports in an understandable way. Our current website: https://www.dhs.gov/ohss In this example, it would be great to have a tab for the narrative at the beginning of the report, then a tab for each category (Lawful Permanent Residents, Refugees and Asylees, Naturalizations, Nonimmigrant Admissions, Enforcement Actions) that has an accordion for each table within the category. Without tabs, users would have to scroll through a list of 42 accordions. Given that most users are only interested in one category of data, tabs would allow users to get to their category much more quickly. Here's an example from the Office of Natural Resources Revenue that took a pdf and turned it into an interactive page with a combination of tabs, cards, and accordions. Participants in usability testing found this and similar pages to be very easy to understand. https://onrr.gov/references/valuation/processed-gas-example?tabs=overview A combination of tabs and accordions also works well for things like troubleshooting related to a particular topic. Example: https://onrr.gov/reporting/revenue?tabs=troubleshooting Longer-term, we want to have more data visualizations on our site and tabs would also be a great way to toggle between different types of visualization or between visualization and corresponding documentation or downloads. We'd be willing to help build and test the tab component. I also found a couple of federal agencies that have a component documented as part of their design systems. |
Beta Was this translation helpful? Give feedback.
-
Here at ICF, we came up with a CSS way to change the accordion to work like tabs -- allowing us to still be compliant with USWDS while also having tabs -- which is a very necessary component it web design. We are surprised it's still not a core component. Anyway, the code snippet proposed above is so much cleaner than the accordion component. We would love to move in that direction. The only question we have is about responsive - by using the accordion-- we just revert to an accordion on smaller break points. Hopefully this purposed tab component would work the same way. Other than that concern, I would push to get this done asap. We would be willing to assist in building and testing. |
Beta Was this translation helpful? Give feedback.
-
Tabs proposal – The United States Web Design System
The purpose of this document is to explain the customer impact the Government Transformation Team’s tab component will have from its implementation into The United States Web Design System (USWDS). The document also provides a demo environment and specs outlining the design of the component.
Introduction
The Government Transformation Team (GTT) at Amazon Web Services (AWS) uses The United States Web Design System (USWDS) as the principal design system in our open-source application, Performance Dashboard on AWS. In lieu of a tabs component included within USWDS, we have designed and developed a tabs component by embracing the inclusive design principles and visual guidance from USWDS to meet the needs and expectations of our public sector customers.
In this document, we explain the user impact of implementing this tabs component into USWDS and highlight practical user needs that support its introduction. We provide the design of our tabs component; including code, a working demo environment, and research that supports the validity of its design. In doing so, we hope to prove this tabs component will meet the needs and expectations of customers by being implemented into The United States Web Design System.
User impact
The impact to users from the implementation of this tabs component can be categorized into two groups. The first group are those who design and develop public facing experiences with the help of USWDS and its open-source design system. We refer to this group as ‘builders’. These are professionals like Software Development Engineers, Solutions Architects, UX Designers, Visual Designers, Product Managers and more. The second group is the ‘end-user’ or ‘end-users’. These are the people who will use and interact with the experiences built using USWDS. These people are the real humans, the citizens of all abilities who deserve and expect accessible experiences that work for them when they interact with their governments and digital public-facing services.
Builders using USWDS know that the experiences they build for citizens need to work and behave like the experiences these citizens use on other websites and apps throughout their lives. This is known as Jakob’s Law of UX. It states: “Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know.” The experiences that have yet to be built using USWDS need to leverage components that citizens use on other websites they know and love. This means having the ability to use components that behave the way they expect them to, that allow them to complete tasks and make actions the way that is easy and familiar to them. Including a wide range of components will empower builders using USWDS with a component toolkit readily available to them to build the citizen facing experiences of tomorrow.
Builders also know time is of the essence when building these experiences. They may sense an immediate need for including as many familiar components as possible to solve problems within large-scale products and services provided by the U.S. government. On December 13, 2021, U.S. President Joseph R. Biden signed an Executive Order titled “Transforming Federal Customer Experience and Service Delivery to Rebuild Trust in Government”. Its purpose, at its core, is to re-build trust in government by improving the experiences the citizens of the United States use to interact with their government. Named in this Executive Order are 17 federal agencies who are called upon to deliver these improved experiences through IT modernization and human centered design. These agencies include the State Department, Treasury Department, Interior Department, Agriculture Department, Education Department, Office of Veterans Affairs among several others.
A tabs component will also provide builders benefits in time and money. By providing a readily available tabs component within the USWDS, builders will no longer need to spend time to seek out third-party open-source design system components that will fulfill their user needs and expectations. Additionally, an available tabs component will eliminate the costs accrued to design, develop, test, and implement a custom component; saving time and money that can now spent developing public serving applications. USWDS will be able to provide further guidance on when builders should use tabs, when to consider something else, and additional support by including a component overview page as seen with other components within the library. To help facilitate the introduction of this tabs component, we have included a draft of what may be included in a tabs overview page in this proposal. (See Tabs – Component overview.jpg.zip).
The agencies listed above are a subset of a larger audience of builders and end-users who either currently rely on USWDS, or will rely on USWDS in the future to modernize their experiences. No matter the agency, or public sector entity, each will have user journeys and personas that map out key tasks they will want to solve for their end-users.
In a reimagined experience on va.gov, a veteran relying only on their keyboard will be able to use tabs to compare their healthcare overview from 2022 to the previous year the same way a mouse and keyboard user would.
A farmer in rural Ohio who relies on a screen magnifier and a screen reader can identify the farm loan program they are looking for which has been labeled by tabs and are properly displayed and functional when zoomed in at 400%, and read by a screen reader.
The executive order alone has the potential for a large-scale user impact – yet it only represents a subset of users who rely on USWDS to provide experiences to their end users. The true impact to the end user of a USWDS tabs component built by federal agencies, private and public sector builders who are tasked with designing a better experience for the citizens they serve is endless.
Design
The constructed design file can be found in provided file titled ‘Tab – Design Demo.fig.zip’
Component code
The tab-style css class has three states:
1. Unselected/Inactive
The state a tab displays when it is not selected, or showing content.
2. Selected/Active
The state displayed after a user has clicked or tapped a tab which displays only the content belonging to the tab selected.
3. Hover
Displayed when a user is hovering over the selection area.
Component preview
To preview the tabs component live in any browser, use this link. Or copy this link into your browser: https://demo.badger.wwps.aws.dev/fire-safety-and-emergency-medical-services.
Accessibility
Flows that use our tab component were audited and accessed against WCAG 2.1 guidelines. These audits identified accessibility barriers for users with cognitive disabilities, low vision users, and keyboard only users. The results of these tests have concluded the application and tabs component to be WCAG 2.1 compliant.
Accessible design included in component:
• Tabbing to highlight active state
• Aria-label for screen reader to indicate each tab is a ‘tab panel’, and its name
• Aria-label indicates if currently selected is the ‘active tab panel’
• Keyboard interaction: Pressing Enter select the active, highlighted tab panel
• Arrow key tab functionality
• Hover state used as a signifier
WCAG References
1.3.1 Info and Relationships (Level A)
Understanding Info and Relationships | How to Meet Info and Relationships
4.1.2 Name, Role, Value (Level A)
Understanding Name, Role, Value | How to Meet Name, Role, Value
2.1.1 Keyboard (Level A)
Understanding Keyboard | How to Meet Keyboard
2.1.3 Keyboard (No Exception) (Level AAA)
Understanding Keyboard (No Exception) | How to Meet Keyboard (No Exception)
Contributors
Mazen Kharbutli, Software Development Engineer, AWS
Miguel Abreu, Software Development Engineer, AWS
Tanner Bachelor, User Experience Designer, AWS
Additional context
Tabs – Component overview.jpg.zip
Tabs – Design Demo.fig.zip
Beta Was this translation helpful? Give feedback.
All reactions