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

Back to top link #1599

Closed
JovdP opened this issue Jul 20, 2021 · 14 comments · Fixed by #2990
Closed

Back to top link #1599

JovdP opened this issue Jul 20, 2021 · 14 comments · Fixed by #2990
Assignees
Labels
Component A component in the ONS Design System IxD Needs input from Interaction design

Comments

@JovdP
Copy link

JovdP commented Jul 20, 2021

What

Back to top link component

Why

To Enable users to get back to the table of contents at the top of the page

Explain why you think this feature or content should be added to the ONS Design System.

  • What evidence do you have that your ONS service needs it?
  • What evidence do you have that it meets the needs of the users of that service?
  • Have you checked if it’s already in the ONS Design System?
  • Have you considered creating a new variant of an existing feature instead of something new?

Supporting material

Research from 2018 prototypes (DP to provide)

Include links to any examples, research, prototypes or code that support your proposal.

Contacts

The Design System working group has a weekly meeting. We will invite you to one of these meetings to give a show and tell about your proposal and answer any questions. Please tell us who to invite to that meeting. We recommend involving at least your product manager, user researcher and designer.

Display: Take users back to top

@JovdP JovdP added the New feature proposal A proposal for a new component, pattern, style or documentation to add to the ONS Design System label Jul 20, 2021
@jrbarnes9 jrbarnes9 changed the title Proposal: Back to top link Back to top link Jul 20, 2021
@jrbarnes9 jrbarnes9 added Component A component in the ONS Design System and removed New feature proposal A proposal for a new component, pattern, style or documentation to add to the ONS Design System labels Jul 20, 2021
@armstrongb
Copy link

Current 'default state' of the back to top link:
BackToTop-base

A key line was added based on research conducted around Area Profiles. The key line helps to highlight the navigation item.

Originating designer: Will Richards
Source file: Figma
Page context used in research (attached)

DatasetLandingPage-996

@jrbarnes9
Copy link
Contributor

@armstrongb Do you think this link could be "sticky" to avoid the visual repetition? I think we could probably still ensure it's focusable after each content block.

@yatesn yatesn added the Community backlog An issue raised on the community backlog label Jan 28, 2022
@emilymaylawes
Copy link

emilymaylawes commented Jul 10, 2023

Accessibility considerations:

  • Must be an anchor link that targets an anchor # to the top of the page. Either the <h1> of the page or the <main> content (alternative to skip to content). In that case, keyboard focus is managed.
  • Must be the last link of the content so right at the end of the focus order within <main>, just above the footer.
  • If sticky to the bottom or anywhere on the page, must not obscure any other content on all screen viewports and not obscure focus.
  • Must not rely on JavaScript
  • Should only have one on the page, rather than repeated
  • If scroll-behaviour property in CSS is used, ensure we turn this off with @prefers-reduced-motion media query

@adi-unni
Copy link
Contributor

adi-unni commented Sep 25, 2023

Technical side:

  • It can be added as an overlay by adjusting the z-index
  • It can be added as a component to be added at the bottom of the page
  • It can be added to fit within the page contents on the navigation sidebar
  • Behavior can be modified depending on zoom level. If zoom is too high and nav sidebar disappears, then button can be moved to main content block

Dev Note: Adjusting the behavior to be controlled based on the presence of @media content max-width class

Any dynamic behavior can only be enabled through javascript. If javascript is enabled:

  • component could be floating on the page
  • hidden/revealed depending on the where the user is scrolled to on the page
    scrollable

Accessibility:

Keyboard users can already reach the top by tabbing at the end of the page or pressing the home button, unless they are in a text entry box. Does it meet accessibility requirement: https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/proposed/ if this is the case.

Needs to be compatible with VoiceOver when used and is not hidden i.e. when the user has scrolled more than 4 screens down the webpage and the button becomes available to click.

Further considerations:

  • Link styled as a button/button or as styled as a link/link
  • Primary location / (optional) secondary location
  • If the button is an overlay, will it be transparent/ translucent , or otherwise. Adjusting transparency may make it more visible when covering other content
  • Will the button be visible all the time, when user has scrolled to a particular or only at the end of the page

NNG recommendations are for the button to be placed in the bottom right as this is where the users expect it to be. Implication is for it to be hovering over content.
https://www.nngroup.com/articles/back-to-top/

Other Versions:
Intelligence community DS:
https://design.sis.gov.uk/components (Button is a floating component featured in the bottom right)
Scottish Gov DS:
https://designsystem.gov.scot/components/back-to-top (Button is a floating component found in the bottom right)
Gov UK DS:
https://design-system.service.gov.uk/components/back-link/#top (Button is a floating component found in the sidebar navigation - on magnification 400%, it merges with main content block
Gov UK DS style 2:
https://www.gov.uk/guidance/redundancy-help-finding-work-and-claiming-benefits#contents

@adi-unni adi-unni removed their assignment Oct 9, 2023
@adi-unni adi-unni self-assigned this Nov 21, 2023
@yatesn
Copy link

yatesn commented Nov 30, 2023

Decision on next steps needed - Joe and Dina to review

@Majsol
Copy link

Majsol commented Nov 30, 2023

There are several products interested in implementing the "back to top" component so the considerations above will be presented at the design crit session on tuesday... and hopefully we will reach a decision that accommodates most products.

@Majsol
Copy link

Majsol commented Dec 6, 2023

Waiting for feedback from IDS (Alan and Aurora)

@JNATION85 JNATION85 added IxD Needs input from Interaction design Blocked labels Dec 8, 2023
@JNATION85
Copy link
Contributor

Can we go ahead with the development that Adi has done.

@adi-unni
Copy link
Contributor

Display - Building a back to top button

@adi-unni adi-unni removed Needs validating Community backlog An issue raised on the community backlog labels Dec 19, 2023
@yatesn yatesn removed the Blocked label Dec 20, 2023
@adi-unni adi-unni linked a pull request Jan 9, 2024 that will close this issue
2 tasks
@JNATION85
Copy link
Contributor

Need to get some content and page structure to preview on the DS

@daniellecorke
Copy link

Content design request added to the UCD centralised backlog.

@adi-unni adi-unni mentioned this issue Feb 13, 2024
2 tasks
@ons-ds-team ons-ds-team added Component A component in the ONS Design System In Development and removed Component A component in the ONS Design System In Development labels Feb 20, 2024
@adi-unni
Copy link
Contributor

adi-unni commented Feb 26, 2024

The width of the BTT button is currently set to the width of the last sibling element in the HTML e.g. if the element above it is a grid, then the width will match that. Here are a couple examples of this behaviour:

Screenshot 2024-02-26 at 11 39 25

When the window is smaller, the highlighted section looks like this:

Screenshot 2024-02-26 at 11 40 26

The proposed change would make the highlighted state look like the skip to content header when highlighted i.e full page width. Here are some examples of this:

Screenshot 2024-02-26 at 11 57 03

With a similar look on smaller pages:
Screenshot 2024-02-26 at 12 06 32

However on larger window sizes the look of the button looks like this:
Screenshot 2024-02-26 at 11 58 36
as compared to this:
Screenshot 2024-02-26 at 11 57 49

From a UX standpoint, what would be the best thing to do here @JNATION85 @Majsol ?

@JNATION85
Copy link
Contributor

@adi-unni Full width is fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component A component in the ONS Design System IxD Needs input from Interaction design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants