alphagov / govuk-design-system-backlog

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

Button #34

Open govuk-design-system opened 6 years ago

govuk-design-system commented 6 years ago

Use this issue to discuss the button component from the GOV.UK Design System.

timpaul commented 6 years ago

Related article: Disabled buttons suck

pds2208 commented 6 years ago

Why are there two different methods used to render a button? The start button type used an <a> tag while the other two use <button>?

kr8n3r commented 6 years ago

Hi, thanks for getting in touch start "button" is a link to the next page so it's appropriate to use a tag for this.

When used in a form then a button or input type=submit tag should be used

nubz commented 6 years ago

There seems to be no new govuk style, guidance or examples for secondary buttons, previously achieved with class name button--secondary. Is this to be seen as discouraging their use?

joelanman commented 6 years ago

@nubz Hi - we don't currently have any guidance or examples in the GOV.UK Design System, and as far as I can tell, this wasn't provided in GOV.UK Elements either.

In general we recommend using only one call to action on a page, styled as our green button. However there are services where there's a user need for a secondary button. We need to gather some evidence on when secondary buttons help, and get that pattern into the Design System. Would you be able to help with that? Posting research/user needs in this thread would be great.

nubz commented 6 years ago

Thanks @joelanman - in one service we used them for an ajax address lookup where some users entered upwards of 20 addresses in a single form and spreading out the related questions for each address as one thing per page did not make sense - grouping related questions and the address lookup together in a single form page tested well with our users. secondary-button-use-case

frankieroberto commented 5 years ago

Could we add:

In general we recommend using only one call to action on a page, styled as our green button.

To the Design System guidance (along with any research to support this)?

davidolsan commented 5 years ago

We are working on "Add a course" backend portal used by the Providers to add a new course.

Think of Gmail inbox with each email being a course with a date, duration, cost etc. Now just like Gmail I need various buttons - archive, duplicate, delete etc.

Any idea how these buttons would be (if anyone has done this and have an example that would be super helpful) implemented on one page as a GDS design pattern?

thaskeengithub commented 5 years ago

I am following GDS and I have to create Secondary and Tertiary buttons for the site, but couldn't find these buttons styles in GDS, if anyone has done please share, it will be helpful. - Thanks

edwardhorsford commented 5 years ago

I wonder if button should be wrapped in <div class="govuk-form-group"></div> by default? or as an option?

I've joined a service and our cancel links sit weirdly with buttons - I suspect in most situations (page per thing), you'll want the button to be a block level element - whereas right now it behaves as if it's inline.

edwardhorsford commented 5 years ago

I think it would be helpful if other colours were supported for the buttons. The most common ones in active use in services I've seen are grey secondary buttons, blue buttons, and red buttons (delete actions).

I don't think the old Elements button macro exists any more, so users need to define the background colour, the hover colour, and the shadow colour. I wonder if these could be provided for the common buttons in active use.

edwardhorsford commented 5 years ago

Example of delete button in our service: screenshot 2019-02-18 at 15 02 51

For reference, I used $govuk-error-colour for the background colour.

I used the shade function from this post - as suggested by @dashouse.

I used hover shade of 10% and bottom shadow of 50%

MatthewBurstein commented 5 years ago

To anyone looking at implementing @edwardhorsford's solution above by using the button component and overrriding some styles, it is necessary to override the styles for the button when it is disabled, and also when it is focused, but not hovered.

vickytnz commented 5 years ago

I'm not an expert on red-green colourblindness but when I've put the red and green through Sim Daltonism under deuteranopia the two buttons look pretty much exactly the same in terms of shade - is there sufficient difference in the shades of buttons in these situations? image

joelanman commented 5 years ago

@vickytnz it's a good point and potentially we can look at improving the design for colourblind people, but it's important to note colour isn't the only thing conveying meaning here - the button text does too.

edwardhorsford commented 5 years ago

In principle the buttons could be the same colour. So it's not an absolute barrier for users.

With that said, we make them different because we think one should be clearly the primary one - and we should try to continue that.

The general luminance between both primary and secondary should be different - which it looks like it is. @vickytnz in the example above they don't look the same - the 'save and continue' looks much darker / different from the 'save as draft'. Can you explain what looks the same to you?

joelanman commented 5 years ago

@edwardhorsford I think Vicky's referring to Primary vs Destructive, not Secondary

jrbarnes9 commented 5 years ago

Does anyone have any recent accessibility research findings on the use the 'start now' links (buttons) with voice recognition software? (eg. Dragon).

The start now button relies on the aria role 'button' to make use of the 'click button' voice command to show the user all the buttons on the page. Aria role isn't supported by versions of Dragon below v13, which, as pointed out in the blog post Results of the 2016 GOV.UK assistive technology survey, is not the most commonly used version of Dragon (well not in 2016, at least)

accessiblewebuk commented 5 years ago

In the accessibility lab at GDS we are running versions 13 and 15 on which the start buttons do work. I can’t recall now if they didn’t work with v 12 or 12.5. I would anticipate there wouldn’t be much usage now below version 13 and if the button doesn’t work directly with Dragon there is the option for the user of Mousegrid which should operate it without difficulty (although I always tell people that is a bit of a compromise)

jrbarnes9 commented 5 years ago

Thanks @accessiblewebuk for your response.

Do we have any more recent data about assistive tech usage (and versions)? Does anyone know of any plans to conduct another assistive tech survey?

antimega commented 5 years ago

From a Slack conversation - I think the wording proposed for the buttons is odd - do users really need to know information is saved at every step? surely that's assumed. It leads to some screen reader issues where different buttons for "save and continue" and "save and exit" sound alike.

joelanman commented 5 years ago

@antimega You might be right, but just to say that not all services do Save and continue - shorter transactions without accounts like Register to vote for example

antimega commented 5 years ago

Most services I've seen don't use Save and continue.

terrysimpson99 commented 5 years ago

@antimega @joelanman If there are two buttons ('Save and continue' and 'Continue without saving') then the distinction might be important but I can't imagine that situation arising. If there's only one button then I can't see a significant benefit in describing whether it saves or doesn't.

a184studio commented 5 years ago

(AGENT FACING) Has anyone come across something like this before?

Screen Shot 2019-07-22 at 15 44 35
timpaul commented 5 years ago

Hi Mark - could clicking on the download button act as the confirmation? I imagine the service would be able to tell if the user had done that, and then you wouldn't need the checkbox at all.

a184studio commented 5 years ago

Hi @timpaul , I've missed out that it is an 'AGENT facing' system.

The risk is that the AGENT will leave without the PDF downloading in time. The service needs to compile everything that the AGENT has collected over the phone. (The compiling is quite slow). There is also the risk that it may not initiate the download. If you leave using 'Finish and close' it will clear the session and now there will be no option of a second attempt at downloading the PDF.

The session is only stored within the bowser and so there is a risk the AGENT may lose everything, which I guess is our worst case scenario.

The following this step is that it needs to be entered into a legacy system, until we can pry it away and the PDF is no longer needed.

timpaul commented 5 years ago

Aaah, the reality of government legacy tech. We'll get there :-)

edwardhorsford commented 5 years ago

@a184studio the way it's worded makes me think you're ok to check it as soon as you click the button - so you might get the same issue that it's marked before the download is completed. I'd look to see if you can make it clear you're interested in whether the download has completed.

a184studio commented 5 years ago

@edwardhorsford Yeah, it's basically for an AGENT to double check the download was successful, the data is there and go back into the service and close the session.

But you are right, there would be nothing to stop an AGENT from clicking the checkBox then leaving without the data, but if they didn't download the PDF they will lose everything.

jesseyuen commented 5 years ago

I wonder if styling the disabled button with cursor: not-allowed would provide more affordance to the user?

edwardhorsford commented 4 years ago

@colinrotherham shared the modal they're working on for timeout warnings: Screenshot 2019-10-02 at 15 05 21

Because of Aria requirements, the button is focused when the modal is loaded. But is a yellow button right in this case? The style is distinct when the user has moved focus on to an element, but is it right when that element is loaded in the focused state?

(NB I'm not suggesting it shouldn't be focused - only raising the styling as a potential issue).

titlescreen commented 4 years ago

@edwardhorsford We have done a similar thing with our modal and it looks the same. What I read at the time said that the first input should have focus, which in this case is the resume application button. So yeah I think what you have done is correct.

I think a non-accessible user would expect the button to be green, but I don't think it's a big problem. If anything seeing the button a different colour might encourage them to read the popup...

https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html

edwardhorsford commented 4 years ago

I'd like to suggest that the design system site include an explicit example of links styled as buttons. The start now example is one such case, but unless a team knew it was a link, they may not find it. For content only pages with a 'continue' button, I'd normally expect teams to use a link - but there's no example of how to do this.

titlescreen commented 4 years ago

I have a bit of an issue with buttons styled and links and visa-versa. It makes me sad when I press space on a button to trigger it and it doesn't work because it's actually a link. I've guess people who navigate via keyboard have seen this kind of kayak issue before and recover from it quickly but it may burn some goodwill.

joelanman commented 4 years ago

@titlescreen it's a good point, our links styled as buttons have javascript to make this work:

https://github.com/alphagov/govuk-frontend/blob/master/src/govuk/components/button/button.js

edwardhorsford commented 4 years ago

I'd like to suggest that the design system site include an explicit example of links styled as buttons. The start now example is one such case, but unless a team knew it was a link, they may not find it. For content only pages with a 'continue' button, I'd normally expect teams to use a link - but there's no example of how to do this.

This came up again today - where a user didn't know the design system supported this. I'm think I may raise as an issue against the design system repo.

Edit: new issue opened here.

simonwhatley commented 3 years ago

When the new gov.uk/transition landing page launched in August 2020, the design included a blue 'start now' button rather than the standard green.

transition landing page blue button

The start now button leads to a multi-question from, called the 'transition checker'. The checker is designed to provide a personalised set of actions an indvidual or business needs to take in order to be ready for the UK's exit from the European Union.

At the beginning of September we ran an A/B test on the landing page to determine whether the button colour had an impact on users engaging with the checker. The test was a simple one, we changed the button to green in line with the standard pattern.

transition landing page green button

The results were conclusive, changing the colour of the start now button from blue to green improved the click-through rate to the checker by 9%.

This improvement is likely, in part, due to green being what users expect for start buttons on GOV.UK. It also stands out more against the blue on the transition landing page.

selfthinker commented 3 years ago

The NHS found some problems in user research with buttons being full width in mobile view: https://github.com/nhsuk/nhsuk-service-manual-backlog/issues/7

A significant number of teams said that the full width gov button on mobile screens was problematic in user testing - it took many users time to realise it was a button (some thought it was a title, some the bottom of the screen).

CharlotteDowns commented 3 years ago

GOV.UK Design System working group review: Updated button styles component

Representatives from the GOV.UK Design System working group reviewed this contribution in December 2020.

Based on a majority vote, the group decided that:

They also made the following recommendations.

Guidance

Design

Code

Next steps

Based on this feedback, the GOV.UK Design System team have agreed to:

joelanman commented 3 years ago

from an accessibility report, a comment on the grey secondary button:

Low vision users reported that they struggled to identify the purpose of the grey links from the styling. This is due to the low colour contrast of the grey background of the links against the white background of the page.

Low vision user comments:

“I found that the buttons that say Add IP addresses, is difficult to recognise as an interactive button due to the lack of contrast between the background colour and the page colour. I feel that it would be easily recognised as a button if it had a black border. I know that there is a state change on mouse-over, but it is very slight and can easily be missed, if the I wasn’t concentrating.”

owen-bennett123 commented 3 years ago

Further to @joelanman 's comment. we have just done some user testing with a partially sighted user (blind in one eye). For most of the journey they seemed pretty confident but we noticed that they struggled with the grey secondary button in a few places.

adamliptrot-oc commented 2 years ago

I was wondering about why the button contents are centre-aligned below a certain breakpoint when the general approach is for left-aligned content on mobile.

This can mean that on mobiles with a magnifier being employed, a user will have to move over to the right to see the button contents.

Screenshot approximating what I see when testing on mobiles with a magnifier.

form showing an input with a label and a green rectangle below, the text of the button is off-screen
edwardhorsford commented 2 years ago

@adamliptrot-oc Before my time, but I speculate it's because on mobile we use full width buttons and it helps keep the button looking more 'balanced'.

Comparison from my service with and without the centreing. Screenshot 2021-09-29 at 18 27 42 Screenshot 2021-09-29 at 18 28 05

asier-hmrc commented 2 years ago

Following previous comments re: issues in recognising full width buttons on mobile as well as magnifier users, it would be worth considering fitting the button to its content and aligned to the left. This way it will align better within its reading context. It will look less like a section header or banner and it will be in sight of magnifiers. Using the example above,

mobile button left aligned

asier-hmrc commented 2 years ago

And on the subject of button likeness, what happens when a button text extends over multiple lines? The current styles extend the button to full container width and centre-aligns text to it, weakening it button-ness. Line-height is tight too. Button-two-line-example-–-GOV-UK-Design-System

I think such buttons should maintain its 'desktop' styling -- the button adjusts to its content with 10px padding either side. A paragraph-like line-height would be good for readability. Line brake would have to be controlled by limiting button width. Left aligning its content would favour magnifier users.

For example

timeout-edited-3

titlescreen commented 2 years ago

Thats an interesting one. I'm not sure buttons should be that long to go onto multiple lines. I think they should be short and to the point which may mitigate the need for this work. For example instead of Continue checking what help you can get with childcare costs I would change the button to be Continue or Continue checking.

I think if a button gets too long then it can become harder to understand what it will do. We spent a bit of time with content designers working on keeping our buttons short, providing an idea of what it will do/where the user will go.

image

asier-hmrc commented 2 years ago

@titlescreen I completely agree, buttons should be short and to the point. It is part of their 'button' identity. The guidelines should specify this to prevent the example I showed earlier. Putting a limit of a single line to a button when in its smallest form (mobile) would be helpful.

chrisadesign commented 2 years ago

Some questions around labels when save and return is an option, there seems to be some inconsistency.

The design system has:

The GOV.UK Sign In service uses a ‘Continue’ button and ‘Save and complete later’ link in their documentation.

adamliptrot-oc commented 1 year ago

Is there a reason why the hover states for buttons (and links) are so slight compared to the focus states? I was on a call yesterday with a low-vision user who was using a large mouse pointer but struggled to see when the buttons and links were under it as the state change wasn't apparant.