Skip to content

ux: Implement a scroll-to-top floating action button #81

@AlAfiz

Description

@AlAfiz

Description

As the pools page gets longer, users will have to scroll heavily to get back to the navigation bar.
We need a small "Scroll to Top" button that appears in the bottom right corner of the screen only after the user scrolls down.
This is a highly appreciated quality-of-life feature for data-heavy applications.
It keeps the user experience smooth and frictionless.

Requirements

  • Create a ScrollToTop.tsx component.
  • Use a React useEffect to listen to the window.scrollY position.
  • Only render the button if the scroll position is greater than 300 pixels.
  • When clicked, use window.scrollTo({ top: 0, behavior: 'smooth' }) to smoothly animate back to the top.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions