Repository navigation
Tabs #6045
Replies: 84 comments
|
@adamsilver and @trevorsaint have very kindly agreed to develop this component, using their work on tabs in the Reform pattern library. The Sass and JavaScript for their tab component is available on GitHub. |
|
@adamsilver and @trevorsaint have reported that the original version of the component is being used successfully in the following services (amongst others): Criminal Justice Services (CPP)
Judiciary UI internal systems (HMCTS)
Rural Payments (Defra) |
Tabs component criteriaFollowing 2 discussions with @adamsilver and @trevorsaint we've agreed that, in addition to meeting the Design System criteria, this component will meet the following additional criteria: Coding criteriaThe tabs component must:
Design criteriaThe tabs component must:
Guidance criteriaThe tabs component guidance must:
Research criteriaThe component must have been tested with a representative range of users in a prototype or live service. Accessibility criteriaThe tabs component guidance must:
|
|
I'm wondering if it's helpful to split this work into smaller chunks, something like:
I think 1. might be significantly easier to do, and easier to get through the process and deliver value quickly. We could then enhance it to 2. |
|
@trevorsaint and @adamsilver - what do you think? Would that help, or do you think that both chunks will be ready in good time? |
|
We've already tackled all of those things now and we're close to finishing V1 (subject to crit etc). |
|
We just had a quick discussion about this on the team - to try and summarise (these are all just thoughts and not a steer in any particular direction): It might be tricky to convey when teams should use version 1 (full page navigation, tabs link to content on separate pages) and version 2 (all content on one page, enhanced with javascript to switch between them). Version 1 seems to be in wide use around government. Version 1 is useful when the pages are quite large, and combining them in version 2 would mean users download a lot of data they don't necessarily need. We need to be careful to only use ARIA on version 2, it would be incorrect on version 1. |
|
Following a productive discussion with @adamsilver and @trevorsaint we've agreed the following:
|
|
Léonie Watson blog post on accessibility testing, including tabs via @accessiblewebuk |
|
Also of interest https://inclusive-components.design/tabbed-interfaces/ |
|
DWP using JS tabbed interfaces with research showing the need and proof of accessibility testing |
|
DWP draft guidance |
|
These DWP internal services use tabbed panels with JS:
|
|
Probably worth mentioning on here that our stance on tabs at DWP was not to have both tabbed navigation and javascript tabs with the same styling. The reason being that if they look the same, the expected behaviour is the same, but it's not. We opted to keep our tabs styling for the progressive enhanced version, and for our tabbed navigation, we are going to switch to a component with different styling. This way you don't see two things that look identical and have an inconsistent experience with how they work. Also, the user need for having the JS tabs over the tabbed nav fell out of research we did on Bereavement, where our agents were getting disorientated. The tabs were a little way down the page, and when we used the non-js version it would pop them back to the top and they would lose their place. We also tried doing it with anchor links to the ID's, but it never quite puts them back to the same place. It's still jarring, and it was creating unnecessary cognitive load to try and orientate themselves again. |
|
Some of the Accordion guidance, I think, is relevant to Tabs. https://paper.dropbox.com/doc/Accordions-4lnTjyNru2mN1XXjA1Xf3 |
|
thats good to know but it doesn't really answer the question, especially when it appears to be recommended against in that link:
|
Apologies for late response. We have JAWS 2022 on POISE machines |
Thanks. I can confirm the issue is also in JAWS 2022 and all older JAWS versions that I could find (down to JAWS 16), but not in JAWS 2023 (with which I had initially tested). I will update the related issue accordingly. |
|
I am a full-time screen reader user. With NVDA version 2021.1 (The version we have on POIS). The interaction of the tabs is as expected. I enter focus mode for the interaction. Select the tab I want using right and left arrow (up and down do switch tabs as well). I will test on the latest version of NVDA and JAWS when I can get to a personal device. |
That just made me realise that I didn't notice when I tested that the screen reader would go into focus/forms mode automatically. I guess I heard the beep but didn't pay attention to it. This makes much more sense now. Thanks for checking this and describing your interaction. I guess it is working as intended after all. (With the exception of NVDA and Firefox due to an additional other bug.) |
|
I've been looking in to using the tabs component on our service (Alcohol Duty Reform), and when I've been using it, I've noticed that the component uses JavaScript - I was wondering if anyone is able to clarify the reasons for using JavaScript with this component, when it can be done with just CSS? Is it for accessibility? The main problem with using JavaScript with the component is obviously how it's then displayed if JS is disabled, whereas using just CSS would negate this. Thanks |
|
Hi @geoff-bell 👋🏻 From some quick desk research, I'm assuming you're referring to using radio inputs and labels as functional hooks for css to manage switching between tab views instead of click events in js, like this codepen. The rest of this comment will be based on that. If there's another solution I've missed, I'd like to hear it! The history of this component is a bit tricky to track as it pre-dates us moving 100% to github to document our tech and design history so a chunk of this will be speculation. I suspect the reason this was originally built in js was browser support. Back when we supported older versions of IE, the css necessary for this to work wasn't supported by older browsers. In addition because we're styling something that has a specific intent (an input for a web form) it's difficult to progressively enhance into, say, just headings and content because older browsers will steer towards defaulting to how that element normally looks. It's probably possible now that we've dropped IE support from 5.0, however it's something I expect we'd still want to investigate thoroughly. It'd require a lot of maintinence to ensure a smooth screen reader experience (which is already a known issue with our tabs currently) considering we're breaking semantic rules, and we'd still want to make sure it doesn't make services impossible to interpret or use for the very small percentage of old browser users. It's also worth noting that tabs should be considered a content enhancement rather than a critical piece of your design and content infrastructure. When js is disabled or fails to load they default back to basic headings and content without js, similar to our accordion component. Personally speaking, I'm wary of using radio inputs against their semantic intent and introducing risk, especially for accessibility, just so that we don't have to ship js. Tabs are one of our more advanced components that we're hoping to revisit soon and we can keep this in mind when we get to it. |
|
Hi @owenatgov - thanks for your quick response! That makes perfect sense and that was the method I was referring to. Thanks again for your reply! |
|
Hi, we have run into a small issue when combining tabs with notification banners. Apologies if this is not the correct forum. |
|
Hi there! I have a quick question about this tab pattern from an accessibility perspective, which I don't think is answered in this thread but I may have missed it! I just wondered if there was a particular reason why the border around the current tab and panel is rendered in such a low-contrast shade of grey? My thinking was that the visual language giving users a cue that they are in a tab panel (and that the links alongside the current tab are other tabs) would be available to more users if this grey was just darkened down somewhat to hit a better contrast ratio than its current ~2:1. Whether that's taking it all the way down to match the near-black text shade, or even just darkening it down to something around #767676 to hit around 4.5:1 (surpassing the Non-Text Contrast minimum requirement of 3:1). But I wasn't sure if there might be another reason from other research etc to explain the choice of grey shade. If not, consider this a suggestion 🙂 |
|
Hi all, I hope you're doing well, happy Friday 🎉 I'm one of the devs from View and Change 😃 We're wondering if there is anything that can be done regarding the Tabs component, and the problem of the tabs wrapping/moving to a new line? As not many of our users are actually using tablets (~0.7%) we wanted to avoid doing a content change as this would effect all users and would need to be researched and user tested. We were able to partially fix it directly in the browser by overriding the div wrapper class Our proposed solution to this would be to have these tablet resolutions use the mobile CSS i.e when the tabs become a list of links and their respective panels all display on the page sequentially. Or if possible some kind of system that can detect the tabs wrapping, and then moving to the mobile style. |
|
Hi all, Hope you are well. We recently had an accessibility audit and an issue was raised around confusing announcements associated with the tabs component which I wanted to make you aware of. When viewing the tabs on a mobile device, a screen reader reads outs the 'em-dash' which is displayed beside the tab name. Please let me know if you need anymore details or if there is somewhere else I should raise this. Thank you. |
|
Heya @LucyGeddis, Thanks for letting us know... If you know, could you let us know what the specific operating system for the mobile device was and what screen reader was being used e.g. talkback or voiceover or something else? |
|
Hi @NickColley , These are the details for the mobile devices and screen readers used:
Many thanks. |
|
@LucyGeddis I have moved your report into an issue on the GOV.UK Frontend project repository for us to consider, thank you! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Tabs
Use this issue to discuss this pattern in the GOV.UK Design System.
Contributors
Related components
Related links
All reactions