New Component Request: Back to Top button
Nobody has claimed this yet.
- Dominant language
- SCSS
- Stars
- 298
- Forks
- 83
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 1
Description
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: https://github.com/mozilla/bedrock/issues/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
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/
- Use a Back to Top button for pages that are longer than 4 screens.
- Place a persistent Back to Top button in the lower right side of the page.
- Label the button Back to Top.
- Have one sticky Back to Top link per page instead of including multiple links in every section of the page.
- Keep the button small so it doesn’t cover important page elements.
- Make the button stand out visually on the page rather than blend in.
- 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
- Make the button stationary.
- 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/
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Neutral button styling linked in the issue and the design-system patterns for reusable components. Define the Back to Top behavior from the requirements: fixed lower-right positioning, delayed appearance after scrolling, responsive use, and light styling on both backgrounds. Done means the component meets these behaviors and remains unobtrusive on short pages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scss
- Domain
- design, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100