alphagov / govuk-design-system-backlog

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

Alternative button styles #154

Open joelanman opened 6 years ago

joelanman commented 6 years ago

What

Alternatives to the default green button style.

Why

There is sometimes a need to differentiate between buttons. For example, where there are multiple buttons on a page and some need greater or less prominence than others.

Alternative button styles have been observed in multiple government services.

Working group review, March 2019

Styles for 'secondary' and 'destructive' buttons were contributed to the GOV.UK Design System by the Design System team on 13 March 2019.

Preview this contribution

The team also considered contributing 'quiet' and 'link' styled buttons, but decided that there was not yet sufficient evidence that they were widely needed (in the case of 'quiet' buttons) or could be made accessible (in the case of 'link' buttons).

Anything else

joelanman commented 6 years ago

GOV.UK Notify:

image

samuelhwilliams commented 6 years ago

I'd find this useful for styling buttons as destructive, as in this example from Notify below. It feels like it should be possible to extend the .govuk-button class and apply a custom base colour to your new selector in sass.

screen shot 2018-08-28 at 12 02 06

armstrongb commented 6 years ago

We found that making the button content 'link blue' in colour helped to avoid users thinking that the secondary button was disabled. secondary-button

joelanman commented 6 years ago

@armstrongb thanks! Was it previously black text on the same grey? Did you find a lot of users thinking it was disabled in research?

armstrongb commented 6 years ago

@joelanman the black didn't even get as far as formal research, we did some local pop-up testing and it was a high proportion of users that found the blue cognitively faster to use; and as it was a harmonious fit between button and links as a group of interactions we didn't undertake further research.

simonwhatley commented 6 years ago

In the claim crown court defence fees service, we tend to use blue as a secondary button colour.

Below is an example where a provider (solicitor, barrister or fee clerk) can add multiple miscellaneous fees related to a claim.

multiple-buttons-1

frankieroberto commented 6 years ago

We have this grey as a secondary button on an admin interface:

screen shot 2018-09-14 at 14 17 26

It's not ideal contrast-wise, and ideally we'd separate out "Save" and "Send to Review" as actions on two different pages, but it's what we have for now.

adamsilver commented 5 years ago

Here we have “global actions” in the top right and page level actions within the page, aligned left as normal.

image

timpaul commented 5 years ago

We have moved this to the 'To do' column of the community backlog as this work is likely to be needed by other components like Filter a list and Edit a list.

dashouse commented 5 years ago

Draft contribution in progress - https://github.com/alphagov/govuk-frontend/pull/1207

edwardhorsford commented 5 years ago

Services occasionally have the need to have many buttons on a page - such as a long table where each row has one or more actions. I've commonly seen this done by styling a button that looks like a link - visually this seems to work well.

I know verify also used to have buttons styled like links for some secondary and uncommon actions - though couldn't find it when looking earlier this week.

It would be great if the design system explicitly covered this use case - markup to use, any semantics to think about. Or if it's not ok, guidance on what to do.

Example from service in development at BEIS: localhost_3000_cosmetics_landing-page_notified-cosmetics

In this example, a list of errors is displayed at the bottom with a 'dismiss' button that destructively clears the error. There could be tens or hundreds of these errors.

edwardhorsford commented 5 years ago

Some more examples of secondary actions as links:

Register to vote

screenshot 2019-02-21 at 11 36 26 (these are anchor tags, enhanced with javascript)

Examples in this thread

I note that two of the examples above also appear to include what might be buttons styled as links (though they possibly navigate to a confirmation page instead).

screenshot 2019-02-21 at 11 34 05 screenshot 2019-02-21 at 11 34 14

edwardhorsford commented 5 years ago

The 'open all' action on the accordion component: screenshot 2019-02-21 at 11 53 58

(hasn't got an underline, but otherwise looks like a link)

edwardhorsford commented 5 years ago

Cancel links might also often be 'buttons' - if they're doing a destructive action (flushing a cache?).

screenshot 2019-02-22 at 13 10 50

soniaturcotte commented 5 years ago

Here’s some examples of what we do on Content Publisher (new publishing app for GOV.UK).

All of these examples have been through multiple rounds of testing, including with users with different assisitive tech, and have performed very well.

Primary and secondary buttons

The secondary button is only ever used when paired with the primary button. In each case, the available actions change depending on the state of the document.

A couple design considerations:

content-summary-actions

We did try other combinations early on, but none of them had the same balance and heirarchy. Here are a couple of those examples, but there were many varied combinations.

screen shot 2019-02-26 at 09 00 24

Destructive links and buttons

We use the same two-step model as GOV.UK Pay and GOV.UK Notify for any destructive actions. If selecting ’Delete draft‘ link in the screenshots above, they get a banner with confirmation step.

Design considerations:

screen shot 2019-02-26 at 09 02 52

Quiet buttons

We have one more button style in the app, which is only used for ‘copy to clipboard‘.

Design considerations:

screen shot 2019-02-26 at 09 09 15
amyhupe commented 5 years ago

Working Group Review

A proposal to add secondary and warning buttons to the Design System was reviewed by the Design System working group–a panel of designers from GDS, HMRC, HMCTS, DWP, EA and Home Office on 28 March 2019.

Review outcomes

The group agreed that the alternative button styles should be published in the GOV.UK Design System.

They also made the following recommendations:

Design

Guidance

Research

The Design System team will aim to address as many of the recommendations as possible before publishing.

edwardhorsford commented 5 years ago

I'm finding the new reduced contrast grey on secondary buttons really hard to see - I imagine on many monitors it might show as pure white. It's not essential that it always be seen, but it would be nice if it had more contrast / outline.

Screenshot 2019-08-02 at 10 57 59

It's also been raised that it doesn't work any more when used on ligiht grey itself. Previously we had panel colour and secondary buttons (and whatever grey they were) worked on top of it. My service uses buttons like this - but with the new grey they become invisible: Screenshot 2019-08-02 at 11 00 46

What it used to look like: Screenshot 2019-08-02 at 11 02 37

Panels aren't so commonly used, but sometimes really help - it would be great if the buttons worked on it and didn't become invisible.

titlescreen commented 4 years ago

Further to @edwardhorsford's comment on the button contrast, would we consider darkening the govuk-colour("green") from #00703c to #006636? We had some instances of the button font being smaller than 19px which was making the button harder to read for some users.

That tweak would hit AAA contrast for normal text on a button and nudge the design system a bit closer to AAA.

If this was accepted then we would probably want to alter the hover background colour as well, but I think the underline we already have would serve as the non-colour designator.

christopherthomasdesign commented 3 years ago

Hi @titlescreen thanks for your comment and sorry it took so long to reply

We’ve already darkened the green once, and we’re trying to avoid everything tending towards black over time. That can happen if you make lots of isolated contrast improvements without keeping an eye on the overall palette. There's a blog post that covers our reasoning for the overall colour changes in more detail.

I'd be interested to hear more about the user need that led to changing some button text to 16px – it's not something we currently recommend.