npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@alvalens/react-fullpage-snap

v1.0.2

Published

Fullpage scroll snap for React with smooth animations - zero dependencies

Readme

@alvalens/react-fullpage-snap

A lightweight, modern React library for fullpage scroll snapping with smooth animations. Built from the ground up for React with zero dependencies and full TypeScript support.

Features

  • Smooth scroll snapping between sections
  • Keyboard navigation (Arrow keys, Page Up/Down, Home/End, Space)
  • Mouse wheel scrolling with momentum detection
  • Touch/swipe support for mobile devices
  • Hash-based navigation (/#section-name)
  • Menu synchronization with auto-highlighting
  • Framework agnostic - works with Next.js, Remix, Vite, etc.
  • TypeScript support out of the box
  • Lightweight - no external dependencies
  • Performance optimized with RAF-based animations

Installation

npm install @alvalens/react-fullpage-snap
# or
pnpm add @alvalens/react-fullpage-snap
# or
yarn add @alvalens/react-fullpage-snap

Basic Usage

import { FullPageProvider, FullPageWrapper, Section } from '@alvalens/react-fullpage-snap';

function App() {
  return (
    <FullPageProvider
      scrollingSpeed={1000}
      anchors={['home', 'about', 'projects', 'contact']}
      menu="#navigation"
    >
      <FullPageWrapper>
        <Section>
          <h1>Home</h1>
        </Section>
        <Section>
          <h1>About</h1>
        </Section>
        <Section>
          <h1>Projects</h1>
        </Section>
        <Section>
          <h1>Contact</h1>
        </Section>
      </FullPageWrapper>
    </FullPageProvider>
  );
}

Menu Integration

<nav id="navigation">
  <ul>
    <li data-menuanchor="home">Home</li>
    <li data-menuanchor="about">About</li>
    <li data-menuanchor="projects">Projects</li>
    <li data-menuanchor="contact">Contact</li>
  </ul>
</nav>

Add this CSS for active menu highlighting:

.section {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

li.active {
  /* Your active styles */
}

Programmatic Navigation

Use the useFullPage hook to access navigation methods:

import { useFullPage } from '@alvalens/react-fullpage-snap';

function NavigationButtons() {
  const { moveTo, moveNext, movePrevious, getActiveSection } = useFullPage();

  return (
    <div>
      <button onClick={() => moveTo(0)}>Go to first</button>
      <button onClick={() => moveTo('about')}>Go to about</button>
      <button onClick={moveNext}>Next section</button>
      <button onClick={movePrevious}>Previous section</button>
    </div>
  );
}

API Reference

FullPageProvider Props

| Prop | Type | Default | Description | | --------------------- | ------------ | ------------- | ------------------------------------------------ | | scrollingSpeed | number | 1000 | Scroll animation duration in ms | | anchors | string[] | [] | URL anchors for each section | | menu | string | undefined | CSS selector for menu (uses data-menuanchor) | | lockAnchors | boolean | false | Prevent anchor changes in URL | | keyboardScrolling | boolean | true | Enable keyboard navigation | | touchScrolling | boolean | true | Enable touch/swipe navigation | | wheelScrolling | boolean | true | Enable mouse wheel navigation | | scrollThreshold | number | 50 | Wheel delta threshold for triggering scroll | | touchThreshold | number | 50 | Touch swipe distance threshold (px) |

Callbacks

<FullPageProvider
  onSectionChange={(prevIndex, nextIndex) => {
    console.log(`Changed from ${prevIndex} to ${nextIndex}`);
  }}
  beforeScroll={(origin, destination) => {
    console.log('Before scroll', origin, destination);
  }}
  afterScroll={(origin, destination) => {
    console.log('After scroll', origin, destination);
  }}
>

useFullPage Hook

const {
  moveTo,           // (index: number | anchor: string) => void
  moveNext,         // () => void
  movePrevious,     // () => void
  getActiveSection, // () => SectionInfo
  setAllowScrolling, // (allow: boolean) => void
  activeIndex,      // number
  isScrolling,      // boolean
  scrollDirection,  // 'up' | 'down' | null
  totalSections,    // number
} = useFullPage();

License

MIT © Alvalen Shafelbilyunazra

Credits

Created by Alvalen Shafelbilyunazra

Inspired by fullpage.js by Alvaro Trigo