More Premium Hugo Themes Premium React Themes

React Scrollspy

:six_pointed_star: react scrollspy component

React Scrollspy

:six_pointed_star: react scrollspy component

Author Avatar Theme by makotot
Github Stars Github Stars: 425
Last Commit Last Commit: Aug 7, 2021 -
First Commit Created: Aug 8, 2025 -
default image

Overview

The Scrollspy component provides a useful way to track which section of content is currently in view while scrolling through a webpage. It is particularly helpful in user interfaces where navigation between sections needs to sync with the current position on the page. Though it is marked as deprecated and no longer actively maintained, it serves as an interesting solution for those who may still want to implement it, albeit with the recommendation to consider GhostUI as an alternative.

This component allows for various customizations and interactions, making it flexible enough for different use cases. With properties that allow fine-tuning of class names, scrolling behavior, and events, it caters to developers looking for a straightforward method to enhance user experience on their websites.

Features

  • items: Accepts an array of IDs that map to your target content sections, making it easy to configure which parts of the page to monitor.
  • currentClassName: Allows the application of a specific class name to the navigation element currently paired with visible content, aiding in style differentiation.
  • scrolledPastClassName: Optionally applies a class name to elements that have been scrolled past, providing visual feedback on which sections are no longer active.
  • componentTag: Lets users specify an HTML tag or React component type for the Scrollspy, offering flexibility beyond the default <ul> element.
  • style: Provides the option to pass custom styles to the generated <ul/>, allowing for easy integrations into various designs.
  • offset: An adjustable numerical value that helps define how close elements must be to the viewport to be considered “in view,” enabling precise control of functionality.
  • rootEl: Specifies a scrollable container for better targeting with querySelector when there are multiple scrollable areas on the page.
  • onUpdate: A callback function that executes whenever the active item is updated, giving developers the ability to trigger custom actions or updates in real-time.