Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons #12

Open
davidhunter08 opened this issue Nov 2, 2023 · 23 comments · Fixed by #117
Open

Buttons #12

davidhunter08 opened this issue Nov 2, 2023 · 23 comments · Fixed by #117
Labels
component Add or improve a design component gp services aka team rainbow ia & navigation aka team frontier native aka team beyond prescriptions & medicines aka team remedy secondary care services aka team compass wayfinder

Comments

@davidhunter08
Copy link
Collaborator

davidhunter08 commented Nov 2, 2023

What

Use this issue to discuss buttons used on the NHS App.

Image

Related

NHS App design system Figma file
NHS design system guidance
NHS design system discussion
GOV.UK Design System guidance
GOV.UK Design System discussion

@davidhunter08 davidhunter08 added component Add or improve a design component ia & navigation aka team frontier labels Nov 2, 2023
@davidhunter08 davidhunter08 changed the title Button Buttons Nov 2, 2023
@davidhunter08 davidhunter08 added secondary care services aka team compass gp services aka team rainbow labels Nov 8, 2023
@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Nov 14, 2023

Full width buttons

Team Frontier have been exploring making buttons full width on the NHS App for smaller screens (640px and below).

Mobile screen

Image

Tablet screen

Image

Next steps

Continue to test to see if:

  • full width buttons are problematic for users with low digital skills
  • users don’t actually see them as actionable things to click

@davidhunter08
Copy link
Collaborator Author

Accessibility notes

3.2 Touch Target Size and Spacing

The high resolution of mobile devices means that many interactive elements can be shown together on a small screen. But these elements must be big enough and have enough distance from each other so that users can safely target them by touch.

Best practices for touch target size include the following:

  • Ensuring that touch targets are at least 9 mm high by 9 mm wide.
  • Ensuring that touch targets close to the minimum size are surrounded by a small amount of inactive space.

3.5 Placing buttons where they are easy to access

Mobile sites and applications should position interactive elements where they can be easily reached when the device is held in different positions.

When designing mobile web content and applications many developers attempt to optimize use with one hand. This can benefit people with disabilities who may only have one hand available, however, developers should also consider that an easy-to-use button placement for some users might cause difficulties for others (e.g. left- vs. right-handed use, assumptions about thumb range of motion). Therefore, flexible use should always be the goal.

Some (but not all) mobile operating systems provide work-around features that let the user temporarily shift the display downwards or sideways to facilitate one-handed operation.

@michaelgallagher
Copy link

i asked about this over in the community backlog a while ago

@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Nov 16, 2023

Button sizing

Current sizing of the NHS design system button.

From screen size width 641px

Image

Height = 60px

  • Border (2px top and bottom) = 4px (transparent to make visible in forced colours modes)
  • Padding (12px top and bottom) = 24px
  • Line-height = 28px
  • Box-shadow (bottom) = 4px

Width

  • Border (2px left and right) = 4px (transparent to make visible in forced colours modes)
  • Padding (16px left and right) = 32px
  • Text length = unlimited

Until screen size width 640px

Image

Height = 48px

  • Border (2px top and bottom) = 4px (transparent to make visible in forced colours modes)
  • Padding (8px top and bottom) = 16px
  • Line-height = 24px
  • Box-shadow (bottom) = 4px

Width

  • Border (2px left and right) = 4px (transparent to make visible in forced colours modes)
  • Padding (16px left and right) = 32px
  • Text length = unlimited

@Tosin-Balogun
Copy link

Secondary or low priority CTA

I would add this here regarding the use of secondary buttons because I think it will become particularly relevant to the app in context where there is a promo but a primary button isn't appropriate.

The current secondary had less design effort compared to the primary and it has weaknesses around versatility across different context, plus when paired with the primary, it is relies on colour alone to make the distinction of hierarchy between them.
nhsuk/nhsuk-service-manual-community-backlog#417

@davidhunter08 davidhunter08 transferred this issue from nhsuk/nhs-app-design-styles-components-patterns Apr 18, 2024
@Tosin-Balogun
Copy link

Prescriptions and medicines use buttons in several of their prototypes

Image

Image

@Tosin-Balogun Tosin-Balogun added the prescriptions & medicines aka team remedy label May 7, 2024
@growe88
Copy link

growe88 commented May 9, 2024

Sticky CTA's

For the past few months, our team has been experimenting with Sticky CTA's, i.e. buttons which remain in a fixed position within the app viewport as the user scrolls up/down a screen. We have been exploring types of screens they may work well, as well as situations in which they would not be suitable.
/
important note: as part of the NHS App visual uplift work, we are now using full width, edge to edge buttons for all CTA's on mobile breakpoints.
/
Some of the perceived benefits of fixed CTA's would include:

  • Accessibility (touch target): by locating the primary CTA above the bottom nav, part of the button should always fall within the ideal thumb touch-target for users (both right and left handed). This is enabled by our addition of full width CTAs.

image

  • Accessibility (next step always visible): when the primary action for the screen is pinned to the bottom nav, it is always visible to the user, without having to scroll below the fold to see where to progress. This allows users to build up stronger mental models.

  • Expectation: users should be able to build up mental models of knowing where to continue a flow. This would be particularly useful for long, repetitive forms with limited content on each page.

Screenshot 2024-05-09 at 10 31 58
  • Modern interface: Sticky button's are a fairly commonplace pattern found in many native experiences (think Trainline, Monzo, Uber, Instagram, Strava, End etc.). Use of this pattern should feel intuitive to users, as well as assisting the UX in feeling more like a sleek, modern experience.
Screenshot 2024-05-09 at 12 07 37
  • Use in a Bottom Sheet component: it is a fairly standard pattern to use a sticky button within a bottom sheet (tray) component. Since the sheet would act as an overlay, covering up the bottom nav, the CTA would be pinned to the bottom on the screen.

/

Potential drawbacks of fixed CTA's would include:

  • Screenreaders: this could prove a complicated pattern to optimise logically for use with a screen reader. Would it read the CTA last and treat it as if it's at the bottom of the content or not? This would require more research.

  • Autonomous clicking of the button: for longer, more repetitive flows which don't require much deeper thought, we run the risk of users clicking the CTA before interacting with/absorbing the content which is on the page. This would result in an error state and hint text explaining what the user needs to do.

  • Users progressing through pages prematurely: pinning the CTA to the nav means that on longer pages, content could be nested below the fold earlier, and even skipped past. This is of course something we would want to avoid.

/

Potential step-around
A possible solution to the possibility of people clicking the sticky CTA and missing content below, could be to add an inactive state to the CTA itself. This would allow designers to disable the CTA until the user has interacted with the page (eg. scrolled to the bottom of the content, or selected one of the radio buttons). We could still find a way to feature hint text if users click the inactive button. My hypothesis is that this would reduce the autonomous clicking of the Primary CTA on the page without any deeper thought.

/

Conclusion
As it stands, we are still toying with the pattern and would like to experiment with some user research. If anyone has any thoughts about this, please feel free to comment below or reach out. And if you think this could be a useful pattern for your screens, we'd love to chat about that too!

/

Useful links:

@edwardscull edwardscull linked a pull request Jul 23, 2024 that will close this issue
@davidhunter08
Copy link
Collaborator Author

Button group example:

Image

@michaelgallagher
Copy link

what do we think about outline buttons?

we've had feedback from users that the standard secondary button looks like it is deactivated.

a outline format might be a way to avoid that impression while providing a button that isn't as emphatically THE MAIN THING as the big green button.

@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Jul 25, 2024

An outline button was recently tested on a load more pattern for booking a gp appointment. [insert findings here]

IMG_6642

@michaelgallagher
Copy link

follow up about the image above: should the bottom edge of the button be thicker, so that it is more like the standard filled button, which simulates a 3D effect with the darker bottom edge?

@davidhunter08
Copy link
Collaborator Author

follow up about the image above: should the bottom edge of the button be thicker, so that it is more like the standard filled button, which simulates a 3D effect with the darker bottom edge?

yeah, I think it does - that will also make it sit well next to a primary button (if used together in a button group)

@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Jul 25, 2024

Possible options

1. NHS blue border + NHS blue box-shadow

Screenshot 2024-07-25 at 19 19 17 Screenshot 2024-07-25 at 19 19 38

2. NHS blue border + darker box-shadow

Screenshot 2024-07-25 at 19 23 19 Screenshot 2024-07-25 at 19 23 31

3. NHS blue border (no bottom border) + box-shadow

Screenshot 2024-07-25 at 19 28 46 Screenshot 2024-07-25 at 19 28 37

@davidhunter08
Copy link
Collaborator Author

Option 2 with states

Screenshot 2024-07-26 at 08 53 47

:hover

Screenshot 2024-07-26 at 08 51 00

:focus

Screenshot 2024-07-26 at 08 51 58

:active

Screenshot 2024-07-26 at 08 53 16

@michaelgallagher
Copy link

michaelgallagher commented Jul 26, 2024

@davidhunter08 i would think option 1 makes the most sense for colour (because it is the most direct), but option 3 makes the most sense for size (so the bottom edge is the same height as the bottom edge on the primary button). not sure how you do that!

also, bit of a curveball: are we willing to consider proposing increasing the size of the bottom edge and/or corner radius for all buttons?

the rationale here is

  • the 3px bottom edge that is standard on buttons doesn't give us much to work with to create the visual effect of the button being 3D if the border is 2px
  • outlined buttons look like they have a sharper corner because the inner edge is quite tight, and that is what the eye focusses on.

some tests...

button tests

@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Jul 26, 2024

Note: Current NHS button attributes

border: 2px solid rgba(0, 0, 0, 0);
border-radius: 4px;
box-shadow: 0 4px 0 #00401e;

To achieve the same size (height) buttons we need to adjust either the border or box-shadow values.

If you have a bottom-border-color: transparent on the outline button, you get a weird looking edge:

Screenshot 2024-07-26 at 12 25 59

If you have bottom-border-width: 0 with a box-shadow: 4px, the button height is 2px shorter than the primary button:

Screenshot 2024-07-26 at 12 32 09

Increasing the the top and bottom padding by 1px each solves that problem and makes the buttons the same height:

Screenshot 2024-07-26 at 12 32 26

But for some reason, in a button group, it misaligns them by 1px 🤔 so I need to look into this.

@davidhunter08
Copy link
Collaborator Author

@Tosin-Balogun
Copy link

Tosin-Balogun commented Jul 29, 2024

@davidhunter08 Have a look at the way I implemented it on Start for life here

The design spec on Figma here
https://www.figma.com/design/3GWK5Kbv5G88L8aKoPBHqd/Start-for-Life-prototypes?node-id=816-3525&t=FlZoluk1DRYpBa9n-4
Screenshot 2024-07-29 at 07 52 42

The actual working code on the 'sign up for newsletter' section
Screenshot 2024-07-29 at 07 54 30

https://www.nhs.uk/start-for-life/

Detail

In terms of the box shadow, I had to remove this because it was overlapping behind the transparent background, what I did instead was to use a 4px border bottom to create that shadow look.

I also reduced the border opacity of the default state to allow for the animation transition when a user hovers or clicks it so it gives that instance feedback that it's an interaction element. In addition, I added a tinted blue for the background when hovering or selected, as well as change the font weight to be default when selected

.s4l-button {
    background-color: transparent;
    border: solid rgba(0, 94, 184, .35);
    border-width: 2px 2px 4px 2px;
    color: #005eb8 !important;
    font-weight: 600;
    box-shadow: none;
}

.s4l-button:hover {
    background-color: rgba(0, 94, 184, .05);
    border: solid #005eb8;
    border-width: 2px 2px 4px 2px;
}

.s4l-button:active {
    background-color: rgba(0, 94, 184, .05);
    border: solid transparent;
    border-width: 2px 2px 4px 2px;
    box-shadow: 0 0 0 2px #005eb8;
    font-weight: 400;
}

Reference

nhsuk/nhsuk-service-manual-community-backlog#417

@MaryHarmon-ID
Copy link

Research findings for secondary buttons

For the Proxy application service, we trialled use of a secondary button on a screen where users could choose from two different actions:

  1. Accessing services for someone else where access had already been set up
  2. Apply to access services for someone new

access-services

Moderated usability research with 10 participants showed that the secondary button was not easily identified as the option to select to continue with a new application. This was mainly attributed to the grey colour.

I'm checking for further findings on this and will update further if more comes to light.

@katydlmh
Copy link

katydlmh commented Sep 16, 2024

Research findings for buttons

Source - NHS Wayfinder usability testing, May-July 2024. We tested new components in the NHS design system as part of our design system uplift work.

1. Full span buttons

Finding: Patients found full span buttons clear and straightforward. They were recognised immediately as buttons and patients were able to move easily through the screens.

Image

2. Button/link assembly component

Finding: Patients recognised two distinct but related actions they could take and had no difficulty in finding both or either option.

Image

thomasleese added a commit to nhsuk/manage-vaccinations-in-schools that referenced this issue Sep 18, 2024
This is to match the designs in the prototype, using a newer button
style that's currently being tested but not yet part of the NHS
frontend.

See nhsuk/nhsapp-frontend#12 for more details.
thomasleese added a commit to nhsuk/manage-vaccinations-in-schools that referenced this issue Sep 18, 2024
This is to match the designs in the prototype, using a newer button
style that's currently being tested but not yet part of the NHS
frontend.

See nhsuk/nhsapp-frontend#12 for more details.
thomasleese added a commit to nhsuk/manage-vaccinations-in-schools that referenced this issue Sep 18, 2024
This is to match the designs in the prototype, using a newer button
style that's currently being tested but not yet part of the NHS
frontend.

See nhsuk/nhsapp-frontend#12 for more details.
thomasleese added a commit to nhsuk/manage-vaccinations-in-schools that referenced this issue Sep 18, 2024
This is to match the designs in the prototype, using a newer button
style that's currently being tested but not yet part of the NHS
frontend.

See nhsuk/nhsapp-frontend#12 for more details.
thomasleese added a commit to nhsuk/manage-vaccinations-in-schools that referenced this issue Sep 18, 2024
This is to match the designs in the prototype, using a newer button
style that's currently being tested but not yet part of the NHS
frontend.

See nhsuk/nhsapp-frontend#12 for more details.
@davidhunter08
Copy link
Collaborator Author

davidhunter08 commented Oct 1, 2024

Secondary button

Design hypotheses

We've observed that users are hesitant to select the secondary (grey) button as they perceive it to be inactive/disabled
If we change the colours of the secondary button
Then users will perceive the button to be active/selectable
We’ll know this is true when we no longer observe users hesitating about whether to click the secondary button

We've observed that the visual hierarchy of the primary and secondary buttons is unclear for people with monochromatic vision
If we change the colours and add a border to the secondary button
Then there will be a clear visual hierarchy between the primary and secondary button for all users
We’ll know this is true when users can describe the two types of buttons as having different levels of importance

Design

Desktop

Secondary button design on large screens

Mobile

Secondary button design on smaller screens

Coded examples

View coded examples (u: app / p: redesign)

Next steps

  1. Test the design hypotheses
  2. Document findings

@anandamaryon1
Copy link

@davidhunter08 This looks really good and something I've wanted to resolve in the service manual design system, any idea on when this will be tested? I'd be keen to get it straight into nhsuk-frontend rather than only the app, if that's possible.

@davidhunter08
Copy link
Collaborator Author

@davidhunter08 This looks really good and something I've wanted to resolve in the service manual design system, any idea on when this will be tested? I'd be keen to get it straight into nhsuk-frontend rather than only the app, if that's possible.

Hey @anandamaryon1, we're currently planning the user research for this, it's looking like it'll be in-person in Leeds on the 13th and 14th November.

@davidhunter08 davidhunter08 added the native aka team beyond label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component Add or improve a design component gp services aka team rainbow ia & navigation aka team frontier native aka team beyond prescriptions & medicines aka team remedy secondary care services aka team compass wayfinder
Projects
Development

Successfully merging a pull request may close this issue.

8 participants