Skip to content

Scroll to top

te-scroll-to-top is a floating button that appears once the page has been scrolled and returns it smoothly to the top.

Usage

It is position: fixed, so it is not shown inline here.

vue
<te-scroll-to-top />
<te-scroll-to-top parent="#my-scroll-container" :offset="200" />

Props

PropTypeDefaultDescription
parentstringundefinedCSS selector of the scrolling element. Defaults to the page.
offsetnumber20Scroll distance, in pixels, before the button appears.

Slots

SlotPropsDescription
iconReplaces the default arrow.

Released under the MIT License.