Skip to content
IndexRequest a UIAboutContact

Back to Top Button

A round button appears after you scroll, shows how far you are with a progress ring, and returns you to the top.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a long article page with a small round white button in the lower right corner showing an upward arrow and a thin blue progress ring around its edge filled to about two thirds, a soft shadow beneath, the article text slightly faded behind, light theme, flat modern style, generous spacing. Variants: the button hidden at the top of the page, and a pill version with the words Back to top. Negative: heavy shadows, clutter, text errors, device frames. Reduced motion: static design.

About this pattern

Definition

On a long page a back-to-top button saves a long scroll. It stays hidden near the top, appears after the reader has scrolled a screen or so, and often includes a ring showing progress through the page. Activating it scrolls to the top and moves focus there.

Purpose & UX principles

  • Show it after about one viewport of scrolling; hide it near the top.
  • Place it in a corner, away from other floating actions and the cookie bar.
  • A progress ring is optional but helpful on long reads.
  • Move focus to the top of the page after activating it.

Interaction states

  • A long scrolling article with the floating button.

Motion specification

  • The button fades and slides in over 200ms; the scroll is smooth.
  • Reduced motion: no fade and an instant jump.

Responsive behaviour

  • Label it Back to top for screen readers; an arrow icon alone is not enough.
  • Use instant scrolling when reduced motion is on.

Code

HTML
<div class="bx"><div class="sc" id="sc" tabindex="0" aria-label="Article"><div id="ar"></div><button class="bt" id="bt" type="button" aria-label="Back to top" hidden><svg viewBox="0 0 40 40" aria-hidden="true"><circle cx="20" cy="20" r="17" fill="none" stroke="#e7e7e4" stroke-width="3"/><circle id="rg" cx="20" cy="20" r="17" fill="none" stroke="#2b59d6" stroke-width="3" stroke-dasharray="106.8" stroke-dashoffset="106.8" transform="rotate(-90 20 20)"/><path d="M14 22l6-6 6 6" fill="none" stroke="#171717" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button></div><p class="out" id="out" role="status"></p></div>

Related patterns

Reading Progress Bar

↗
Reading Progress BarLayout & Scrolling

Floating Action Button

↗
Floating Action ButtonButtons & Actions

Scrollspy Table of Contents

↗
Scrollspy Table of ContentsNavigation