Try Install Learn Blog API Packages GitHub
Pages
mint-ui

Search
Basic information
Entities
Versions
Dependencies
mint-color 0.0.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.

treshold
:
Number
=
50

The treshold (scroll position) to show the button.

zIndex
:
Number
=
800

The z-index of the component.

Functions

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

Scrolls to the top of the page.

render
:
Html

Renders the component.

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

Updates the scroll position.