ArekUI
Docs

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.

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

Options

NameType / valuesDefaultMeaning
ar-scroll-topclass on the buttonrequiredFixed pill in the bottom-right corner on the primary surface, hidden with a fade-and-rise transition until it becomes visible.
data-ar-scroll-topattribute on the buttonrequiredHook for arekui.js: the script listens for clicks on any element carrying it and smooth-scrolls the window back to the top.
ar-scroll-top-visiblestate class, toggled by JSoffAdded past 300px of scroll and removed again near the top; brings the button to full opacity and slides it into place.
svgelement inside—Any icon works; the CSS sizes it to 1.25rem and inherits the button's colour. Keep it decorative and give the button an aria-label.