Backtop

Floating scroll-to-top control.

Backtop

Default

Appears after the scroll container passes 96px and stays at its lower-right edge. It does not need Affix.

Near the bottom

Useful for lists and dynamic loading. visibility-height and visibility-bottom use OR logic. This example sets the former high to demonstrate the 72px remaining-distance trigger.

Custom icon

Use the default slot to replace the built-in arrow with an icon or custom content.

API

PROPS

Property
Type
Values
Description
default
Example
More
bottom
Number
pixels
Set the distance from the viewport, or from the target container when target is set.
40
—
right
Number
pixels
Set the distance from the viewport, or from the target container when target is set.
40
—
target
String
CSS selector
Scrollable container selector. The control is positioned inside this container. Defaults to the window.
—
—
visibility-height
Number
pixels
Minimum scroll offset before the control appears. Either this or visibility-bottom can show the control.
200
—
visibility-bottom
Number
pixels
Shows when the remaining scroll distance reaches this value. Either this or visibility-height can show the control.
—
—
behavior
String
auto | smooth
Native scroll behavior after activation.
smooth
—

EVENTS

Event
Type
Description
default
Example
More
click
—
Fired after scroll-to-top starts.
—
—

SLOTS

Slot
Scope
Description
default
Example
More
default
icon or custom content
Replace the default up arrow.
IconArrow
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied