Try Install Learn Blog API Packages GitHub
Pages
mint-ui

Search
Basic information
Entities
Versions
Dependencies
mint-color 0.9.0 <= v < 1.0.0

Ui.ScrollToTop

A button to scroll to the top of the page.

  • It's only visible if the page is scrolled.
  • It's positioned on the bottom right corner of the page.

States

scrollPosition
=
`window.scrollY`

We have a state for the scroll position.

Properties

global
:
Bool
=
true

Whether or not to display the button globally.

size
:
Ui.Size
=
Ui.Size::Inherit

The size of the content.

threshold
:
Number
=
50

The threshold (scroll position) to show the button.

zIndex
:
Number
=
800

The z-index of the component.

Functions

handleClick
(
event
:
Html.Event
)
:
Promise(Void)

Scrolls to the top of the page.

render
:
Html

Renders the component.

updatePosition
(
event
:
Html.Event
)
:
Promise(Void)

Updates the scroll position.