The back-to-top button is a floating button that appears on all pages, allowing users to quickly navigate back to the top of the page or to the main content area.
The button is automatically included on all pages via ui/website/base.html. It has two modes:
#back-to-top at the top of the page#back-to-topThe button is already set up in ui/website/base.html:
<!-- At the top of the page -->
<div id="back-to-top" class="u-anchor-link" tabindex="-1"></div>
<!-- At the bottom of the page (footer area) -->
<a class="back-to-top u-flex-center" href="#back-to-top">
<svg class="icon icon--medium" aria-hidden="true">
<use href="#chevron-down-solid"></use>
</svg>
<span class="visually-hidden">Go back to top</span>
</a>
No action needed - this works on all pages automatically.
The button automatically updates based on scroll position:
| State | Icon Direction | Behavior | When Shown |
|---|---|---|---|
| Up mode | Points up (rotated 180°) | Links to #back-to-top |
When scrollY > 0 |
| Down mode | Points down | Smooth-scrolls to just below the initial viewport | When scrollY = 0 |
The button styles are in ui/website/css/layout/base.css:
The initializeBackToTop() function in ui/website/js/components/back-to-top.js:
ui/website/base.html (button included here)ui/website/css/layout/base.cssui/website/js/components/back-to-top.js