alphagov / govuk-design-system-backlog

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

'Link' buttons #159

Open 36degrees opened 6 years ago

36degrees commented 6 years ago

What

Buttons that look like links, for secondary or tertiary actions.

screen shot 2018-09-06 at 14 42 36

Example of two buttons – one using our default ('primary') button style, and one styled to look like a link.

Why

We think there are a couple of reasons why designers may want to style buttons to look like links:

It might be that one or both of these needs could be met by secondary buttons instead, which we think might be clearer.

If our position is that we do not think this should be done, we still need to document that, especially if we find that using buttons styled as links does impact accessibility or usability.

36degrees commented 6 years ago

@leekowalkowski-hmrc raised some good points about user expectations in a conversation on Slack:

36degrees commented 6 years ago

Additionally, users might expect to be able to middle-click or alt-click on the 'link' to open it in a new tab, which would not work as expected.

36degrees commented 6 years ago

There have also been discussions around whether a button styled as a link should have role="link", in the same way that links styled as buttons have role="button".

There was extensive discussion around adding role="button" to those links and there is a shim to match behaviour against users expectations (being able to trigger a link with role="button" using the space bar).

NickColley commented 6 years ago

Related to this is the secondary buttons

armstrongb commented 6 years ago

We found from our use (on survey collection at ONS) that users of dictation assistive technology had issues trying to select a button that was styled as a link because the software refused to acknowledge it as a 'link'.

We have since adopted the links must always look like links and buttons as buttons approach and designed accordingly.

timpaul commented 5 years ago

This is relevant, from @adamsilver : https://medium.com/simple-human/but-sometimes-links-look-like-buttons-and-buttons-look-like-links-9b371c57b3d2

leekowalkowski-hmrc commented 5 years ago

Just to nit-pick; in modern web design even buttons themselves very rarely look like buttons, they often look 'probably clickable'. Designers seem so convinced I need better buttons, that I've forgotten what the gorgeous buttons in my lovely sleek modern browser or operating system look like!

Links sometimes don't need to look like links, or buttons, for example image or product galleries, the bigger the click region the better, so the whole container is often clickable and still I'd have a user expectation that it's going to behave like a link and definitely not like a button.

edwardhorsford commented 5 years ago

A few weeks back I added examples from several services using 'link' buttons to the secondary buttons issue. Adding here now as this is the more specific issue.

I feel like it's a more common pattern than people realise - and having a solution to it (or guidance for why it's not ok) would be great.

Examples

Register cosmetics

localhost_3000_cosmetics_landing-page_notified-cosmetics

Register to vote

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

Examples from the secondary buttons thread

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

Accordion component

screenshot 2019-02-21 at 11 53 58 (hasn't got an underline, but otherwise looks like a link)

Cancel links

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

GOV.UK Publishing

content-summary-actions (potentially these really are links going to a confirmation page)

edwardhorsford commented 5 years ago

Skip this page links

Screenshot 2019-03-07 at 11 52 14 Note we have this in my service - pressing it unchecks an option the user had picked on a previous page and notes the current page as no longer required - hence why it's not just a link to the following page.

NickColley commented 5 years ago

Just as another note on 'link buttons', we've noticed that in Firefox for MacOS that 'link buttons' are not part of the default tabbable elements, whereas buttons using <button> markup are: https://github.com/alphagov/govuk-frontend/issues/1464

I have raised a bug for this on Firefox's bug tracker for them to consider: alphagov/reported-bugs#43

edwardhorsford commented 4 years ago

Sharing another example that's come up in our service.

Our page currently looks like this:

Screenshot 2020-05-04 at 15 34 28

The links let admins re-invite users.

Because of technical reasons, these links (which are currently get requests) need to be made in to buttons.

Here's what it would look like with the secondary button style, which I don't think is as effective as the existing link style.

Screenshot 2020-05-04 at 15 35 39