alphagov / govuk-design-system-backlog

GOV.UK Design System Community Backlog
31 stars 2 forks source link

'Select / Unselect all' functionality? #292

Open Ian1West1 opened 7 months ago

Ian1West1 commented 7 months ago

I am working as a SD on the HMRC help and support email service (along with a UR - a team of two). The user logs into the service with their email address, and that email address is then matched with email subscriptions from various HOD data stores. The user is presented with a list of their current email subscriptions, with the checkboxes ticked by default. They are also presented, below that, with a lis of H&S topics which may also be of interest to them (ie topics to which they are not currently subscribed, with the checkboxes unticked). There are a total of 18 topics.

In some cases, eg an Agent/Accountant, the list of subscribed topics may be quite long.

If a user is subscribed to many topics, and therefore has a lot of checkboxes ticked, is there a pattern to allow for 'uncheck all'? This is the sort of thing we'd like to do...

image
joelanman commented 7 months ago

I don't think there is a standard approach yet, but I think there's some discussion in the main Checkbox thread:

I think for accessibility it would be a button rather than a link

Ian1West1 commented 7 months ago

I agree it should be a button (because buttons do things, links go places), but can't find an appopriate button style... ;-) Thank you for the link!

Ian1West1 commented 7 months ago

...there are a few disussions on that page, but they date from 2018/19, and the links to various prototypes don't work any more ;-)

joelanman commented 7 months ago

it would be the standard secondary button:

https://design-system.service.gov.uk/components/button/#secondary-buttons

querkmachine commented 7 months ago

I have sorta wondered if this would be a button, as opposed to a checkbox with special functions, such as the 'none of the above' functionality.

Check it to automatically check all other checkboxes in the set. Uncheck it to uncheck all of the other checkboxes in the set. Likewise, if all other checkboxes are checked, check it; if not, don't.

joelanman commented 7 months ago

yeh I think either could work, pending testing with users. I think a button might be simpler to implement, as you don't have to do the work to keep the states in sync that you mentioned