Skip to content
Calm motion: animations on this site only fade, with no movement

ScrollTop ​

Back-to-top button past a threshold

A back-to-top button for long pages. It shows after the reader scrolls a way down (threshold). Short pages do not need one.

Basic
Scroll this page past 300px — a skewed ↑ button appears bottom-end (fixed to the window).
  • It scrolls smoothly, or jumps straight up under reduced motion.
  • target watches a scroll container instead of the window. label names the button.

Usage ​

ts
import { BlessScrollTop } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
thresholdnumber300px scrolled before the button shows
targetHTMLElement | null—scroll container; default window
labelstring"Back to top"
position"bottom-end" | "bottom-start""bottom-end"

Slots

NameScopeDescription
default—

Released under the MIT License. Character names and artwork belong to their owners.