Socket
Book a DemoInstallSign in
Socket

nikhilhuh-infinite-scroll

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nikhilhuh-infinite-scroll

A simple customizable infinite scroll wrapper for React

1.2.1
latest
npmnpm
Version published
Weekly downloads
294
359.38%
Maintainers
1
Weekly downloads
Β 
Created
Source

nikhilhuh-infinite-scroll

npm version npm downloads license

A lightweight and customizable infinite scrolling component for React.
Easily create smooth, continuous horizontal scrolling carousels with support for text, images, or any custom content.

πŸ‘¨β€πŸ’» Author

Nikhil Tiwari
GitHub

πŸ™ Mentor / Guidance

Debasish Sahoo
GitHub

Features

  • πŸš€ Simple and lightweight
  • 🎨 Supports children or items array
  • πŸ” Smooth infinite scrolling without flicker
  • ⏸️ Pause on hover
  • ↔️ Scroll in both directions (left or right)
  • 🎯 Configurable gap and repeat
  • ⚑ Built with TypeScript

Installation

You can install the package using npm:

npm install nikhilhuh-infinite-scroll

Usage

Example with children

import InfiniteScroll from "nikhilhuh-infinite-scroll";

function App() {
  return (
    <InfiniteScroll duration={25} pauseOnHover>
      <p>πŸš€ Infinite Scroll is awesome!</p>
      <p>✨ Smooth and lightweight</p>
      <p>⚑ Built with TypeScript</p>
    </InfiniteScroll>
  );
}

Example with items

import InfiniteScroll from "nikhilhuh-infinite-scroll";

function App() {
  const words = ["React", "Vue", "Angular", "Svelte"];

  return <InfiniteScroll items={words} />;
}

Example with images (items)

import InfiniteScroll from "nikhilhuh-infinite-scroll";

function App() {
  const images = [
    "https://picsum.photos/id/1015/200/150",
    "https://picsum.photos/id/1025/200/150",
    "https://picsum.photos/id/1035/200/150",
    "https://picsum.photos/id/1045/200/150",
  ];

  return (
    <InfiniteScroll
      items={images}
      type="image"
      height={150}
      duration={25}
      pauseOnHover
      repeat={2}
    />
  );
}

Props

PropTypeDefaultDescription
durationnumber30Controls the duration of the animation (higher duration = slower animation).
direction"left" | "right""left"Sets the scroll direction.
pauseOnHoverbooleanfalsePauses scrolling when hovered.
classNamestring""Add custom class names for styling.
styleReact.CSSProperties{}Inline styles for the container.
itemsstring[][]Array of items to be displayed in the scroll. Can be strings or image URLs
type"text" | "image""text"Defines how the items are rendered. "text" displays strings, "image" treats items as image URLs and applies default styling.
childrenReact.ReactNodenullCustom JSX elements to render inside the scroll instead of using items.
heightstring"auto"Height of the scroll container (e.g., "300px", "100vh").
widthstring"100%"Width of the scroll container (e.g., "500px", "100%").
gapstring"2rem"Space between consecutive items inside the scroll (e.g., "10px", "1rem").
repeatnumber2Number of times the items are duplicated for continuous scrolling.

Example with Props

<InfiniteScroll
  duration={20}
  direction="right"
  pauseOnHover={false}
  className="my-scroll"
  height="250px"
  width="100%"
  gap="3rem"
  repeat={3}
  style={{ background: "#f9f9f9", border: "1px solid #ddd" }}
>
  <p>πŸš€ Infinite Scroll is awesome!</p>
  <p>✨ Smooth and lightweight</p>
  <p>⚑ Built with TypeScript</p>
</InfiniteScroll>

License

MIT Β© 2025 Nikhil Tiwari

Keywords

react

FAQs

Package last updated on 27 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.