Repository navigation
Accordion #6119
Replies: 99 comments
|
I've done some work to extract the Accordion javascript from the Design Manual into a standalone component which no longer requires jQuery. You can see the code here: https://github.com/frankieroberto/accordion |
|
Just a note that the DVSA heroku app link has a password. Below are the details: username: admin Also source can be found here: |
|
we're aiming for Service standard browsers support matrix right? |
|
Thanks @tameemsafi - I've updated the top comment with those details. |
|
@tameemsafi the DVSA components seems to have two versions, one with + and - icons, and the other with arrows. Have you tested both? Any reasons to prefer one over the other? Also looks like your javascript does some scrolling, which I find slightly jarring, but perhaps there's a reason for this? |
|
@frankieroberto We did test both and the one with up/down arrows is the one that was chosen as it was more user-friendly. However, I put both in the styleguide just to show the different versions. The scrolling feature works better if there is more content but I see what you mean that it looks a little annoying on the styleguide page. You can see it being used live here: |
|
We're trying out a version of this in a form on "Find postgraduate teacher training courses": |
|
@frankieroberto has very kindly agreed to work with us on developing this component. The work will be based on https://github.com/frankieroberto/accordion |
Accordion component criteriaIn addition to meeting the Design System criteria, we have agreed that this component will meet the following additional criteria: Coding criteriaThe accordion component must:
Design criteriaThe accordion component must:
Guidance criteriaThe component guidance must:
Research criteriaThe contributor must:
Accessibility criteria
|
|
This contribution in being worked on GOV.UK Frontend by @frankieroberto, see further details here: alphagov/govuk-frontend#958 |
|
The Worldwide section of GOV.UK uses accordions on the country pages, eg: |
|
This looks really good—nice one, Frankie! Here’s some notes/questions:
|
|
I agree with @edwardhorsford, content is now much harder to scan and significantly more scrolling is required to get through the same amount of information. Especially for internal services, where users are expected to interact with complex data on a daily basis, the accessibility tradeoff doesn't hold up. Is there a chance to have the old design back for internal services please? |
|
Hi @edwardhorsford and @stagarz, Thanks for your feedback. We had a short discussion about this within the team last week. In short, we don't consider this to be a priority. The new accordion design has been thoroughly tested with users (including those with access needs), tested with assistive technologies, and reviewed by accessibility experts. The new implementation is WCAG compliant; the old implementation was not. Although we are aware and accept that the new accordion is harder to scan and takes up more vertical space, we consider these to be reasonable trade-offs for the sake of making the accordion accessible. We don't feel like there is a compelling reason to make changes to the design at this time, especially as many of the accessiility problems with the original version were visual in nature. We are confident that the new design is a marked improvement on the original. We encourage implementors to really think about the compromises needed to continue using the older design and to carry out user testing on anything new (or old, in this case). If you do carry out testing (ideally including assistive technology users) then we'd be interested in seeing it! |
|
Our content designers requested that direct-linking to an element ID within the accordion should open that section immediately. Therefore, I have written this JavaScript to achieve that: It is yet to be reviewed by our other developers, but I thought I'd share it here before I forget. |
|
@MalcolmVonMoJ as well as adding the
Without also taking care of these things the various bits of the interface are likely to get out of sync, and the expanded state will not be communicated correctly to assistive tech users. |
|
Thanks for replying Ollie. Originally I thought that would be the case. But it was pointed out to me that if I only add |
|
I have a use case which I believe is similar to @edwardhorsford's comment above on 17th May. It's not a public-facing service; the users are local authority staff in a role requiring some data processing expertise. We are supplying them an error report for a spreadsheet of data they've uploaded; there could be many errors in each of many rows in the spreadsheet. Ideally I'd like the first thing they see to be an overview, where each row in the spreadsheet has one row in the overview that summarises how many errors there are in that row but without going into detail. Then I'd like the user to be able to expand each row to see the full details of the errors in it. Hopefully that description makes sense. It seems to me that the "old" design Ed refers to - which I haven't used before - is a better pattern for this than the new one, as there could be dozens of rows (accordion sections) and the new accordion design would take up a lot of space, be daunting to users, and be very hard for a user to scan to get that overview of the report. Are the "old" accordion designs / macros available somewhere for my team to implement and test? (We would look into the accessibility issues at the same time and aim to test with assistive technology users. If there's a summary of the issues somewhere that would help us ensure we're addressing the right things.) Alternatively if there's a better pattern for our use case then I'm very open to recommendations! |
|
Arguably, using I'd say either use |
|
Currently, the demo at https://design-system.service.gov.uk/components/accordion/ uses |
|
We have removed the 'Experimental' tag from components, patterns, and guidance in the Design System 😌. The tag was being used on the Accordion component to raise awareness that more research is needed to validate it. However, we recently published new guidance on how to share findings from users which we hope will make it easier to collect more information about how our Design System is being used across services. If your team has used this component please let us know 💪🏻. |
|
Was there a stage in the development of this component where the following choice was made? I'm keen to hear if there was any research or user testing around this issue. Sorry if it's in here somewhere already, I have tried to find it! |
|
@patrickhlauke Noticed that your comments went uncommented upon. Your thoughts regarding Opening this as an issue on the frontend repo would give it more visibility. You can do that, or someone on the team can do it if you'd prefer. The use of @Jeff-Cuss I think this got asked and answered elsewhere, but my reckoning on this is that showing all sections is just the more common action a user is likely to want. For example, a user may show one or two sections with promising-sounding headers to find what they want, not find it, and choose to show all of them so that they can scan through everything. Conversely, a user seems fairly unlikely to want to hide all sections unless they're trying to visually declutter a page for some reason (maybe printing?) In all likeliness, if the accordion doesn't have what they're after, they'll just leave the page rather than hiding everything. |
Many thanks for following this up and for the further information @patrickhlauke |
|
Hello, I'm currently working on a service that utilises the accordion component. As part of testing, we've run the Axe accessibility tool, which has flagged a critical issue with the use of the
I can see from the list of known accessibility tool issues there has been an accordion fix for the |
|
Hey @HenryEscott-IPO, At a glance, this seems to be raising an error because the content of the accordion section does not have an I can't say for sure without seeing the other HTML for the accordion, but it looks like 'accordion' has been typo'd as 'accordian' in the |
|
@querkmachine amazing thanks for the support and speedy response. Dodgy 'accordian' typo aside, it looks like we were setting the |





Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use this issue to discuss the accordion component in the GOV.UK Design System.
All reactions