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

@sunsama/infinite-horizontal-swiper

v0.4.0

Published

A performant horizontal infinite swiper for React Native.

Readme

Sunsama Infinite Horizontal Swiper

A highly efficient infinite horizontal swiper component designed for the Sunsama mobile app. This library enables smooth, responsive swiping through items (cards) with a natural gesture-based experience.

Note: This README is generated by AI.

Features

  • Infinite swiping: Enjoy endlessly scrolling through items.
  • Spring-based animation: Smooth and natural motion using a physics simulation.
  • Custom rendering: Render cards with a custom function that supports a focused state.
  • Callback support: Respond to index changes with worklet callbacks.
  • Imperative control: Programmatically scroll to a specific index using exposed methods.

Installation

Install the package via npm or yarn:

npm install @sunsama/infinite-horizontal-swiper

Or:

yarn add @sunsama/infinite-horizontal-swiper

Requirements

It might work on any other Reanimated/Gesture Handler version, but it is only tested on the following versions:

  • React Native >= 0.79.2
  • React Native Reanimated >= 3.17.5
  • React Native Gesture Handler >= 2.25.0

Usage

Check out the app in the example folder for a working demo. The example app demonstrates how to use the InfiniteHorizontalSwiper component in a React Native application.

API Reference

Props

| Prop | Type | Description | Default | |-------------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|---------| | renderItem | (index: number, isFocused: boolean) => ReactNode | A function to render each card. It receives the index of the card and a flag indicating whether the card is focused. | — | | windowSize | number | Number of cards to display at once. Must be an odd number greater than 1. Adjusting this can help balance performance and UI smoothness. | 3 | | onIndexChangedWorklet | (index: number) => void | A Reanimated worklet function called when the index changes. Use this callback to respond to changes in focus. | — | | initialIndex | number | The index of the card that should be focused initially. | 0 |

Reference Methods

After attaching a ref to the component (using React.forwardRef), the following method is available:

scrollToIndex

scrollToIndex: (index: number) => void;

Programmatically scrolls the swiper to focus the card at the specified index with a smooth spring animation.

Contributing

We welcome contributions, issues, and feature requests! Feel free to check the GitHub issues page to get started. For feature requests mind you that this is mainly used by us internally, so we might not be able to prioritize your request. We're happy if you want to add a feature yourself and send us a PR.

License

This project is open source and available under the MIT License.