Scroll Top
Jump-to-top button that fades in once the reader has scrolled past the fold - a pill pinned to the bottom-right corner, driven by one data attribute and arekui.js.
Back to top
The button is in the markup but hidden here - it only fades in past 300px of scroll, and this preview cannot scroll that far. This docs site ships it on every page: scroll down a long page to see it live.
<button class="ar-scroll-top" data-ar-scroll-top type="button" aria-label="Back to top">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>
</button><button className="ar-scroll-top" data-ar-scroll-top type="button" aria-label="Back to top">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m18 15-6-6-6 6" /></svg>
</button>Fades in past 300px of scroll · arekui.js toggles ar-scroll-top-visible and smooth-scrolls back to the top on click · pinned to the bottom-right corner · without JavaScript the button stays hidden