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

@mostafa-ashour-dev/react-grid-plus

v4.0.19

Published

A high-performance, flexible grid component for rendering large lists of items efficiently.

Downloads

103

Readme

React Grid Plus

A high-performance, flexible grid component for rendering large lists of items efficiently.

Key Features

  • Responsive Columns: Automatically adjusts grid layout (2-6 columns)
  • Flexible Spacing: Configurable gap sizes for item spacing
  • Dual Scroll Modes: Support for both vertical and horizontal scrolling
  • Pagination Support: Show limited items with a "view more" footer
  • Loading States: Built-in loading component display
  • Type-Safe: Full TypeScript support with generic types
  • Tailwind CSS: Uses Tailwind utility classes for styling

Installation

npm install @mostafa-ashour-dev/react-grid-plus

Usage

Basic Example

import { Grid } from '@mostafa-ashour-dev/react-grid-plus';

interface Item {
  id: number;
  title: string;
  description: string;
}

const items: Item[] = [
  { id: 1, title: 'Item 1', description: 'Description 1' },
  { id: 2, title: 'Item 2', description: 'Description 2' },
  // ... more items
];

export default function MyComponent() {
  return (
    <Grid<Item>
      data={items}
      cols={3}
      gap={4}
      renderItem={(item) => (
        <div key={item.id} className="p-4 border rounded">
          <h3>{item.title}</h3>
          <p>{item.description}</p>
        </div>
      )}
    />
  );
}

Advanced Example with Scrolling

<Grid<Item>
  data={items}
  cols={4}
  gap={2}
  scrollable={true}
  scrollDir="horizontal"
  scrollFit={true}
  maxItems={12}
  footer={{ text: 'View All Items', href: '/all-items' }}
  renderItem={(item, index) => (
    <div key={item.id}>
      <h3>{item.title}</h3>
    </div>
  )}
/>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | T[] | undefined | Array of items to render in the grid. Can be any data type. | | renderItem | (item: T, index: number) => React.ReactNode | Required | Function that renders each item. Receives the item and its index. | | cols | number | 3 | Number of columns in the grid. Supports values 2-6. Applies Tailwind grid-cols-{n} classes. | | gap | number | 4 | Spacing between grid items. Supports values 2, 4, 5, 6. Applies Tailwind gap-{n} classes. | | scrollable | boolean | false | Enables scrolling behavior. When true, combined with scrollDir to determine scroll direction. | | scrollDir | "vertical" \| "horizontal" | "horizontal" | Direction of scrolling. Use "vertical" for vertical scroll or "horizontal" for horizontal scroll. | | scrollFit | boolean | false | Applies overflow and size constraints based on the tallest/widest item. Works with scrollDir for responsive sizing. | | maxItems | number | undefined | Maximum number of items to display. If set and data.length exceeds this, a footer link is shown. | | footer | { text: string; href: string } | undefined | Custom footer link configuration. If not provided, defaults to "View {count} more" text. | | hideFooter | boolean | false | Hides the footer link even when maxItems is set and items exceed the limit. | | loading | boolean | false | Shows the loading component when true. Useful for data loading states. | | loadingComponent | React.ReactNode | <span>Loading...</span> | Custom component to display while loading. Only shown when loading is true. | | className | string | "" | Additional Tailwind CSS classes to apply to the grid container. |