UMD Web Components Library
    Preparing search index...

    Variable scrollTop

    Scroll to Top

    A utility component that provides a smooth scroll-to-top functionality. Displays a button that appears after scrolling down and returns users to the top of the page. Can be positioned fixed or absolute within its container.

    <umd-element-scroll-top>

    • data-layout-fixed - Positioning mode:
      • When present - Fixed positioning relative to viewport
      • When absent - Absolute positioning within parent container
    <!-- Basic scroll to top button -->
    <umd-element-scroll-top></umd-element-scroll-top>
    <!-- Fixed position scroll to top -->
    <umd-element-scroll-top data-layout-fixed></umd-element-scroll-top>
    <!-- Within a specific container -->
    <div class="content-wrapper" style="position: relative;">
    <article>
    <!-- Long content here -->
    </article>
    <umd-element-scroll-top></umd-element-scroll-top>
    </div>

    1.0.0