390 points · by open-source-ux · 4y ago · 129 comments
I was only around for the first six months or so of this project, but I’ve taken so much of what I’ve learnt into my current design system, and I continue to reference GDS’s continuing work as the gold standard for researched user interface patterns.
> Do not use <input type="number"> unless your user research shows that there’s a need for it. With <input type="number"> there’s a risk of users accidentally incrementing a number when they’re trying to do something else - for example, scroll up or down the page. And if the user tries to enter something that’s not a number, there’s no explicit feedback about what they’re doing wrong.
> Do not set the inputmode attribute to decimal as it causes some devices to bring up a keypad without a key for the decimal separator
Also, sad to realise that some of core UX features for HTML, like entering numbers, is so broken three decades later.
https://html.spec.whatwg.org/multipage/input.html#when-numbe...
> The type=number state is not appropriate for input that happens to only consist of numbers but isn't strictly speaking a number. For example, it would be inappropriate for credit card numbers or US postal codes. A simple way of determining whether to use type=number is to consider whether it would make sense for the input control to have a spinbox interface (e.g. with "up" and "down" arrows). Getting a credit card number wrong by 1 in the last digit isn't a minor mistake, it's as wrong as getting every digit incorrect. So it would not make sense for the user to select a credit card number using "up" and "down" buttons. When a spinbox interface is not appropriate, type=text is probably the right choice (possibly with an inputmode or pattern attribute).
If it makes sense for an increment button, it's pretty easy to add with JS, or it could be an optional attribute. I can't remember a case where the increment buttons were useful.
If HTML5 describes information semantics, labels should reflect the term's common usage rather than jargon for specific heavily caveated use cases— Credit card numbers and phone numbers aren't exactly edge cases.
I guess that means text is wrong, too? It seems like the current definition of text is "the type of input you'd put in a text input even if it's only numerals" and the definition of "number" is "incrementable or decrementable." Seems like it should be "general" and "quantitative" or something. Weird slightly counterintuitive instances such as "date fields are the quantity of days, months, or years since X" make more sense than "social security, credit card numbers, phone numbers, id numbers, etc. aren't numbers" to my eye.
If I was maintaining the HTML spec, I'd do two things:
- Deprecate the use of spinboxes on `number` input. Browser vendors would be free to remove the spinbox or only support it in certain circumstances
- Add an explicit `interface` attribute (or equivalent CSS properties and psuedoelements) for specifying the kinds of input UI the form author expects to be available to the user. You'll be able to apply multiples of these and to any form input type (including <select> and <textarea>) without changing their validation rules. The browser picks out options that make sense for the current platform and input type and implements those.
Interface hints themselves would be things like:
- `keyboard` - widget should support virtual input and/or IMEs (on a select, this would also trigger a combobox)
- `numeric` - implies `keyboard`, plus virtual input should be optimized for numbers (on a phone, this means give the user a numeric keyboard)
- `text` - implies `keyboard`, plus virtual input should be optimized for text of the input widget, document, or user's current language
- `nokeyboard` - widget should not support virtual text input of any kind
- `increment` - widget should have numeric increment/decrement buttons (e.g. use a spinbox)
- `noincrement` - widget should omit numeric increment (no spinbox)
- `content` - contents of the field should be visible to the user (even if the field is type=password; this would allow a "show password" box that does not expose the password to predictive text input)
- `obscured` - obscures the text input like type=password
- `nocontent` - contents of the field are entirely hidden, would allow hiding even the length of a password
- `predict` - widget should participate in predictive text
- `nopredict` - widget should NOT participate in predictive text, and should not have it's input be fed back into the predictive text system, like type=password
- `passwordrecall` - widget should support password recall through a password manager
- `nopasswordrecall` - widget should NOT support password managers
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in...
am i the only one seeing this tongue-in-cheek thing?
This is incorrect. We are talking about government services. Language needs to be precise. There are cases where there is a difference between an individual, a couple, and a group of 3 or more. There is also a very tricky case for non-native speakers and those that are not aware of the culture from which these nuances arise.
The guidance must direct the implementors to use specific language. If confronting a situation in which a pronoun gives rise to ambiguity, do not use a pronoun. So, "if your service allows people to jointly apply for something," define it. Is it "your service allows two people to jointly apply," or "your service allows a group of people to apply," or something else? Using "they" is inappropriate. Something like "you and the other individual" is appropriate.
"Does the other person" is correct, accurately describes the scenario, and is comprehensible at essential English reading levels, which is incredibly important.
My only gripe is perhaps if their teams made example pages from their own use cases– sub-nav from the components page, charts/references from their Covid dashboards.
Great work overall!
both the UK gov design system and the US web design system (https://designsystem.digital.gov/). i am always battling with bad UX. that's because i have default settings to help me have a better web experience. once in a while i come across websites designed with care and better experience for the end users. and they stand out.
kudos to the people behind both design systems. you are doing way better than the loud voices we have in the field.
ps: can we get them to adopt a naming convention? (country code + web design system) uswds, ukwds, jpwds, etc...
I’ll definitely be using this on a project we are starting soon instead of tailwind.
Sometimes to move fast one needs opinionated constraints. That’s why bootstrap was so popular and still is.
For me, accessibility has always been kind of an afterthought. Not because I don't think it's important but because I don't really have the knowledge of best practices. I hope someone creates a generator for it because I would easily make this my standard front-end for all new projects.
You can check out the code at https://github.com/alphagov/govuk-frontend
I'd recently complained about my local Council (in the UK) failing to provide accessible information.
If you're into horror shows then feel free: https://eyesiteview.co.uk/galacampus/informal-consultation/e...
It previously used to 301 if you were on Linux and a whole host of other user agents saying "you cannot view this page due to incompatibility".
After 30 years of the web, publicly funded information should be available to all.
Feels like a huge gap in their offerings.
I assume this is configurable and developers just forget to set it, but it’s a weird default.
Would definitely be nice to have
Likewise for underlines on headings – I can't see that in the style guide.
https://web.archive.org/web/20170119063846mp_/https://www.go...
I think it's time for web sites to stop doing custom date inputs. Even Safari finally has a native date input.
The worst are the sites that make you enter a day from a drop-down menu.
Second-worst are the ones that are asking for your birth date as input, but the default drop-down for the year is the current year. As if a six-month-old baby is signing up for a car loan.
Third-worst are the ones that make you pick a day from a drop-down. Bad programmers do this because they're bad at input validation. Well, with your drop-downs I can enter February 31. So now you've got two problems.
I once saw a government web site that had you pick each number from the date input as a separate drop-down. Who builds these things?
https://github.com/alphagov/govuk-design-system-backlog/issu...
https://designnotes.blog.gov.uk/2013/12/05/asking-for-a-date...
https://github.com/alphagov/govuk-design-system-backlog/issu...
At least they do research and document. Thanks for those links.
I build my web sites based on first- and third-party research, but work in an organization stuffed with managers who want our sites to look more like TikTok, because that's what they spend most of their time on, and think we don't look like a real company if we don't have pop-ups and garrish colors, and things flying around the screen. We're a healthcare company.
I had one manager tell me that the company's web site didn't look like a "real" web site because it didn't have lots of little placeholder spinners. Explaining that they're not needed because the page loads in under a second got me a look like when you're trying to explain temporal physics to a collie.
There's more of a discussion here
https://github.com/alphagov/govuk-design-system-backlog/issu...
A deeply flawed one. https://twitter.com/jaffathecake/status/1509447655579176963
My workaround for reliable date entry UI was to have a <input type=text> for date entry, with a second <input type=date> to the right of the text but that styled as a square dropdown icon, with tabIndex=-1, and JavaScript code to sync the two inputs. That allowed typing in the date, and also allowed users to use the browser native date input entry without forcing users. That avoided problems with broken user agents (mobile or desktop or OS).
It is bad. Day month year are separate inputs. No auto-jump to next input. Even if this was done for accessibility reasons, it is not accessible for many on the a11y spectrum.
Also, the component is half baked. How come one can input wrong input and there is no immediate error feedback? How come the error example still shows a validation error despite entering correct data?
Auto-advancing is a non-standard behavior for input fields, it could easily be confusing for users who aren't expecting it. Behavior in auto-advancing fields can also be awkward when going back to edit values, or pasting. I also wouldn't be surprised if it was more difficult for a11y users with screen readers. Keep it simple.
> Also, the component is half baked. How come one can input wrong input and there is no immediate error feedback?
This is covered elsewhere under "Patterns / Validation" [0], they recommend delaying validation until the user attempts to move on to the next section or submit the form.
> How come the error example still shows a validation error despite entering correct data?
I'm not sure what you mean, both examples have clear explanations in the error message; the first example [1] indicates that the date must be in the past and the second [2] is missing the year.
0: https://design-system.service.gov.uk/patterns/validation/#wh...
1: https://design-system.service.gov.uk/components/date-input/e...
2: https://design-system.service.gov.uk/components/date-input/e...
Please, focus on the user as your primary goal of your website, the rest is fluff and can be trimmed. Thank you!
Viewing the same page in landscape mode/bigger screen does show tabs.
Tabs are meant to be presenting only the currently selected option, one reason for that being concise in a constrained environment.
Their tabs implementation does the wrong/opposite thing when it is the most useful (small screen).
Also, it is confusing to have a completely different presentation depending on screen size.
From a usability point of view rendering the content online makes sense.
It has the added benefit of working well for people who have disabled JavaScript too.
To me it makes the headings appear to be more connected to the paragraph above them than below, messing with my semantic overview.
Take a look at this page as an example:
https://www.gov.uk/guidance/living-safely-with-respiratory-i...
Each component describes when you should use it, how to do things, and considers accessibility from all angles.
I'll be having a red through later!
Still legends.
So yes, they did only just go live, they were in beta :)
It is possible to design compact, well functioning and accessible design frameworks. UDWDS is far better in this regard: https://designsystem.digital.gov/
What do you like about this more? The visuals, the documentation, the guidelines, the code?
It isn't good yet:
* The brutalist/minimal style is so reduced yet blown-up I find it confusing to grasp sections. E.g. on first visit (incognito) visiting https://design-system.service.gov.uk/styles/ all this monster cookie notice, footer, whitespace leaves the actual content maybe just 10 percent on a regular desktop screen.
* Tables ( https://design-system.service.gov.uk/components/table/ ) are so minimalistic (no vertical column separators, no color shading to context, no visual scrollability hints), plenty of scenarios exist where visually reading tables becomes hard. You need visual separations between columns when the header is far away (and non-sticky). Also, all this empty table void does not communicate to mobile / small screen users that they can horizontally scroll tables. The mini examples on https://design-system.service.gov.uk/components/table/ don't show these apparent issues.
* Would you have guessed "HTML"/"Nunjuck" have tabbish behavior and reveal content on-page on click? They look like regular navigational links.
* HTML code is way too verbose and there is plenty of unnecessary nested div soups. What is the need for `class="govuk-footer__meta-item govuk-footer__meta-item--grow"`? Do you need to be so specific? (Hint: you don't; a wrapper class is often enough for any further (CSS/JS) matching). https://design-system.service.gov.uk/components/footer/
* Does not allow more than one skip link ( https://design-system.service.gov.uk/components/skip-link ), as they are visually overlapping.
* https://design-system.service.gov.uk/components/inset-text/ There are dedicated HTML elements which semantically fulfill this div component's purpose (`blockquote`, `aside`...)
* File upload component: No value added to what browsers have out of the box ( https://design-system.service.gov.uk/components/file-upload/)
* Buttons and color: No matter if default (green), secondary (grey) or warning (red): the moment these buttons receive focus, they all get the same focus color yellow, thereby no longer communicating their intent visually.
* Accordions, they are just confusing: where does a accordion's content start and end? Put some borders around it. The over-the-top focus highlight adds to this confusion https://design-system.service.gov.uk/components/accordion/
* ... Which brings me to the last point: The screaming focus yellow highlight. This and other stuff in this design system is bleeding-edge accessibility conformity: crank accessibility to 150%, help some with it, but also leave others confused by it. Maybe think about `:focus-visible` instead of `:focus`. But hey, Chrome Lighthouse gives 100/100 ;-). To end on something positive, I checked with NVDA and keyboard input superficially (e.g. search box) and accessibility/ `aria-` markup looked fine.
> HTML code is way too verbose and there is plenty of unnecessary nested div soups.
Can you prove you can obtain the very same result with less tags?
> Does not allow more than one skip link ( https://design-system.service.gov.uk/components/skip-link ), as they are visually overlapping.
Why would you have more than one?
- More than one skip link: If there are several often-used targets within a page, e.g. main content, search input, language select, etc. See the skip links on https://developer.mozilla.org/en-US/docs/Learn for an example.
- https://a11y-101.com/development/skip-link
- https://www.w3.org/WAI/WCAG22/Understanding/bypass-blocksWhat is important is accessibility, clear access to information, good UX.