kit
    Preparing search index...
    • Smoothly scroll the window to a position or to an element, minus the height of the fixed elements (see useFixedOffset) so that they do not cover it.

      The returned function accepts:

      • to: the position (in px from the top of the page) or the id of the element to scroll to
      • customOffset: added to the destination (e.g. -20 to stop 20px before)
      • callback, fallbackTimeout and behavior: see scrollTo from @knitkode/dom

      The destination is never above the top of the page.

      Parameters

      • OptionaldisregardAutomaticFixedOffset: boolean

        Do not subtract the fixedOffset from the to positions. When to is an element id we will keep into account the fixedOffset despite this option.

      Returns (
          to?: string | number,
          customOffset?: number,
          callback?: () => void,
          fallbackTimeout?: number,
          behavior?: ScrollBehavior,
      ) => void