linuss/smooth-scroll/1.0.0

NOTE: the latest version is 1.1.0

SmoothScroll

scrollTo

scrollTo : String -> Task Error (List ())

Scroll to the element with the given id, using the default configuration

scrollToWithOptions : Config -> String -> Task Error (List ())

Scroll to the element with the given id, using a custom configuration

type alias Config =
{ offset : Int
, speed : Int
, easing : Easing
}

Configuration options for smooth scrolling. Has three options:

  • offset: The amount of space in pixels between the element to scroll to and the top of the viewport that is to remain after scrolling
  • speed: The higher this number, the faster the scrolling!
  • easing: The easing function to use. Check out the easing functions package for more information.