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

@rishabhparsediya/react-list

v0.1.1

Published

This is react list similar to flatlist in react native

Readme

react-flatlist

A flexible and customizable React component for rendering lists with efficient infinite scrolling support. This component provides a highly performant and easy-to-use flat list with features like custom item rendering, infinite scrolling, and customizable styles.

Features

  • Customizable Item Rendering: Render items however you like using the renderItem function.
  • Efficient Infinite Scrolling: Automatically triggers onEndReached when the user scrolls near the bottom of the list.
  • Empty State Support: Show a custom component when the list is empty.
  • Customizable Styles: Easily customize the styles of the container and list items with the containerStyle and itemStyle props.
  • TypeScript Support: Fully typed with TypeScript for better development experience and type safety.

Installation

To install the package, use npm or yarn:

npm install react-flatlist
# or
yarn add react-flatlist

Usage

Example:

import React, { useState, useEffect } from "react";
import FlatList from "react-flatlist";

const MyList = () => {
  const [data, setData] = useState<number[]>([]);
  const [isLoading, setIsLoading] = useState<boolean>(false);

  useEffect(() => {
    loadData();
  }, []);

  const loadData = async () => {
    setIsLoading(true);
    const newData = Array.from({ length: 20 }, (_, i) => i + data.length);
    setData((prevData) => [...prevData, ...newData]);
    setIsLoading(false);
  };

  const renderItem = ({ item }: { item: number }) => (
    <div>{`Item #${item}`}</div>
  );

  const keyExtractor = (item: number) => item.toString();

  const handleEndReached = () => {
    if (!isLoading) {
      loadData();
    }
  };

  return (
    <FlatList
      data={data}
      renderItem={renderItem}
      keyExtractor={keyExtractor}
      onEndReached={handleEndReached}
      onEndReachedThreshold={0.8}
      listEmptyComponent={<div>No items available</div>}
    />
  );
};

export default MyList;

Props

| Prop | Type | Description | | ----------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------- | | data | T[] | The array of items to render in the list. | | renderItem | (item: { item: T; index: number }) => ReactNode | Function to render each item. Takes an object with the item and its index. | | keyExtractor | (item: T, index: number) => string | Function to extract a unique key for each item. | | onEndReached | () => void | Callback function triggered when the user reaches the end of the list. | | onEndReachedThreshold | number (default: 0.8) | The threshold percentage of the list's visible height before onEndReached is called. | | containerStyle | CSSProperties | Custom styles for the container of the list. | | itemStyle | CSSProperties | Custom styles for each individual list item. | | listEmptyComponent | ReactNode | Component to render when the list is empty. |

Styling

  • You can use the containerStyle and itemStyle props to style the list container and individual items. The styles are passed as inline CSS properties.

  • Infinite Scrolling

  • The component supports infinite scrolling through the onEndReached prop. By default, the callback is triggered when 80% of the list is visible (onEndReachedThreshold is set to 0.8), but you can adjust the threshold as needed.

  • Custom Empty State

  • You can display a custom component when the list is empty by passing the listEmptyComponent prop. This allows you to show a user-friendly message or component when there are no items in the list.