1. Nimibyte
  2. Open source
  3. Intersection hook
  • NimibyteFrom vision to version
Platform
  • Home
  • Changelog
  • Account
  • Services
Projects
  • AuditAuth
  • Resqly
Open Source
  • Packages (npm)
Academy
  • Architecture
  • Terms
  • Privacy

Intersection Hook

@nimibyte/intersection-hook - Section-aware navigation primitives for React interfaces where active-state must remain predictable.

npmGitHub
ReactNext.jsTypeScript

Design Intent

Avoids repeated scrollspy implementations across product surfaces.

In-page navigation often drifts between pages when section registration and active-state rules are not centralized.

Trade-offs: It favors a narrow API and native browser behavior over highly configurable abstractions.

Intentionally not solving: Route-level navigation state, non-React integrations, or virtualized list visibility semantics.

API Surface

API
  • IntersectionProvider(config?)
  • useIntersection()
  • register({ id, label })
  • activeSection
  • sections
  • scrollTo(id)

Use It When

  • You need table-of-contents style navigation in a React page.
  • You want stable active-section highlighting while users scroll.
  • You need smooth in-page navigation without custom event wiring.

Avoid It When

  • Navigation state is route-driven and already managed by your router.
  • Your interface does not have stable, unique section identifiers.
  • You need non-React framework support.

Engineering Signal

This reflects Nimibyte's engineering posture: narrow public APIs, explicit trade-offs, and predictable runtime behavior. We optimize for maintainable systems rather than clever abstractions.

Explore our engineering approach ->