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

New Component Request: Back to Top button #825

Open
maureenlholland opened this issue Oct 18, 2022 · 2 comments
Open

New Component Request: Back to Top button #825

maureenlholland opened this issue Oct 18, 2022 · 2 comments
Labels
Design 🎨 Issues relating to design tools and processes

Comments

@maureenlholland
Copy link
Contributor

Please describe the use case(s) for this component

On a long page it is useful to have a quick navigate to top option. (see original bedrock issue: mozilla/bedrock#9910)

The button should not appear on pages that are not long enough to need this option

Please provide any designs or previous implementations of the proposed component

back-to-top

potential to use Neutral button styling: https://protocol.mozilla.org/components/detail/button--neutral.html

Please describe what this component does in the following conditions

  • Dark or light background, stays light background and dark arrow up icon
  • When viewed in a mobile/responsive viewport: same positioning as desktop, about 1em from bottom right corner, position fixed & sticky (appears after user scrolls down about 1.5x viewport size)

Please provide examples of this type of component in use in non-Mozilla web properties

Image examples and general best practices here:
https://www.nngroup.com/articles/back-to-top/

  1. Use a Back to Top button for pages that are longer than 4 screens.
  2. Place a persistent Back to Top button in the lower right side of the page.
  3. Label the button Back to Top.
  4. Have one sticky Back to Top link per page instead of including multiple links in every section of the page.
  5. Keep the button small so it doesn’t cover important page elements.
  6. Make the button stand out visually on the page rather than blend in.
  7. Consider delaying the appearance of a Back to Top option until after users scroll a few pages AND indicate that they want to scroll up
  8. Make the button stationary.
  9. Let users control scrolling.

Is the development of this component a blocking dependency for other work? Please explain if so

Protocol team has come to consensus on need after discussion on longstanding bedrock issue. It is not blocking but would be a good UX improvement on pages such as https://www.mozilla.org/en-US/firefox/privacy/book/

@maureenlholland
Copy link
Contributor Author

maureenlholland commented Oct 18, 2022

Couple of open questions:

  1. is 1.5x viewport long enough to wait for trigger to show button or should we follow NN group recommendation of 4x down scroll AND indication user wants to scroll up?
  2. should the page jump to top or scroll to top or choose which of those to do based on user motion pref?
  3. do we want to use "Back to top" text button instead of icon only?
  4. is this a standalone component that can be dropped in any page or an optional feature that is part of the footer component?

@reemhamz
Copy link
Contributor

Thanks for putting this issue together!
As for placement of the button, I would vote for having it appear after a certain height of the viewport rather than all the way down in the footer/end of the page. That way, if it's a long page (i.e. State of Moz), the user has the option to scroll all the way to the top when they're a few sections in.

@maureenlholland maureenlholland added the Design 🎨 Issues relating to design tools and processes label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design 🎨 Issues relating to design tools and processes
Projects
None yet
Development

No branches or pull requests

2 participants