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

@yoge-shource/grid-carousel-react

v0.1.17

Published

Example Button Component

Readme

GitHub license npm version Open Source

Demo: https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--introduction

GridCarousel is a powerful and multi-functional lightweight, flexible ES6 JavaScript slider/carousel library that helps you create responsive and touch-enabled sliders with fast and performant CSS3 transitions. it helps you create a highly customizable, fully responsive, mobile (only mobile) swipe-friendly content carousel/slider with lots of useful functionalities for modern web/mobile designs. Mainly Every div has class so we can overide by using any parent class of app accoriding to requird design and responsive using @media query.

Features

  • Server side rendering
  • custom scroll bar hide/show
  • Multiple items slide
  • Supports images, videos, text content or anything you want. Each direct child represents one slide!, Support any component as a item to put into grid
  • hide/show dots
  • hide/show arrow buttons
  • Autoplay
  • Customized layout Items
  • Customized arrow button
  • Customized dots
  • Each div having class so we can overide css at any time in app
  • Swipe to slide (mobile only)
  • light waight

Install

$ npm install @yoge-shource/grid-carousel-react --save

$ yarn add @yoge-shource/grid-carousel-react

Usage

Just import the GridCarousel component from @yoge-shource/grid-carousel-react
and pass your item into itemComponent prop

import React from 'react';
import GridCarousel from '@yoge-shource/grid-carousel-react';
const Item = ({item}) => (
  <div style={{
    height:'100px',
    width: '98%',
    border: '1px solid #ccc',
    margin: '5px'
  }}>
    {item.name}
  </div>
);
const carouselData = [{name: 'item1'},{name: 'item1'},{name: 'item1'},{name: 'item1'},{name: 'item1'}]
const CustomGridCarousel = () => {
  return (
    <GridCarousel customScrollbar={false} dots={true} carouselData={carouselData} itemComponent={Item} />
  )
}

-- OR --

Second Way

Just import the GridCarousel component from @yoge-shource/grid-carousel-react
and pass your item as childrens

import React from 'react';
import GridCarousel from '@yoge-shource/grid-carousel-react';
const Item = (index) => (<div>{index}</div>)
const carouselData = [{name: 'item1'},{name: 'item1'},{name: 'item1'},{name: 'item1'},{name: 'item1'}]

const Gallery = () => {
  return (
    <GridCarousel customScrollbar={false} dots={true} carouselData={carouselData}>
      <div>
        <img width="100%" src="https://picsum.photos/800/600?random=1" />
      </div>
      <div>
        <img width="100%" src="https://picsum.photos/800/600?random=2" />
      </div>
      <div>
        <img width="100%" src="https://picsum.photos/800/600?random=3" />
      </div>
      <div>
        {/* anything you want to show in the grid */}
      </div>
      {/* ... */}
    </Carousel>
  )
}

Props

| Prop | Type | Default | Description | | ------------------------------------- | ---------------- | --------- | ----------------------------------------------------------------------------------- | | itemComponent | Type of React component or Element | 1 | We need to pass itemComponent and carouselData as props to GridCarousel, then GridCarousel will take this component and loop this component using carouselData and while looping, GridCarousel will send item,...otherprop as pops to itemComponent.page | | carouselData | Array | [] | const data=[{},{}];<GridCarousel carouselData={data} /> page | | numberOfItemToScroll | Number | 10 |<GridCarousel numberOfItemToScroll={2} />| | loop | Boolean | false | Infinite loop or not | | otherProps | instence of Object || Array | <GridCarousel someProp={'tex'} someProp={[]}/> | | hideArrow | Boolean | false | Show/hide the arrow prev/next buttons | | dots | Boolean | false | Show dots indicate the current page on desktop mode | | autoplay | Boolean | | Autoplay true | false | | numberOfCardsToShow | Number | 1 | should be carouselData > numberOfCardsToShow<GridCarousel numberOfCardsToShow={2} /> | | hideArrowsOnEnd | Boolean | false | should be true || false <GridCarousel hideArrowsOnEnd={true} /> // true || false | | customScrollbar | Bool | true | should be true || false <GridCarousel customScrollbar={true} /> // true || false | | children | Type of React children or Element | 767 | should wrap with <GridCarousel> like <GridCarousel carouselData={gridCarouselMockData} > gridCarouselMockData.map((item, itemKey) => ( <div className="carousel-item"><CarouselItem item={item}/> </div>)) </GridCarousel> | | customArrows | object | | should wrap with double braces customArrows={{}}like customArrows={{leftArrow: Arrows, // your Arrow component and do not <Arrow /> leftArrowProps: {left:'right', square:'square'}, // your Arrow component props rightArrow: Arrows, // your Arrow component props rightArrowProps:{right:'right', square:'square'} // your Arrow component props }} | | arrowRight | Element | | Customized left arrow button | | dot | Element | | should be true || false <GridCarousel dots={true} /> // true || false | containerStyle | Object | | Style object for carousel container |

First way of integration

In first way of integration, We need to pass itemComponent and carouselData as props to GridCarousel, then GridCarousel will take this component and loop this component using carouselData and while looping, GridCarousel will send item, ...otherprop as pops to itemComponent.

In This Way itemComponent and carouselData props are mandatory.


   import GridCarousel from '@yoge-shource/grid-carousel-react';
    
    <GridCarousel
      itemComponent={CarouselItem} // your component
      carouselData={gridCarouselMockData}
      otherProps={{
        loading: false
      }} // your other requered props
    />
    </GridCarousel>

or visit https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--first-way-of-integration

Second way of integration

In this second way instedOf passing itemComponent prop, we can loop our component in side GridCarousel like below.

In This Way loop of component and carouselData props are mandatory.

sample


  import GridCarousel from '@yoge-shource/grid-carousel-react';
    
    <GridCarousel carouselData={gridCarouselMockData} >
      {
        gridCarouselMockData.length > 0 && 
          gridCarouselMockData.map((item, itemKey) => (
            <div className="carousel-item">
                <CarouselItem item={item}/>
            </div>
        ))
      }
    </GridCarousel>

or visit https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--second-way-of-integration

Dots Enable

To enable dots in GridCarousel pass dots prop as true dots={true}


import GridCarousel from '@yoge-shource/grid-carousel-react'

In First Way
    
    <GridCarousel
      dots={true} // ---> here <---
      itemComponent={CarouselItem} // your component
      carouselData={gridCarouselMockData}
    />
    
    ---- OR ---- 
   In Second Way
    
    <GridCarousel
     dots={true} // ---> here <---
     carouselData={gridCarouselMockData} >
      {
        gridCarouselMockData.length > 0 && 
          gridCarouselMockData.map((item, itemKey) => (
            <div className="carousel-item">
                <CarouselItem item={item}/> // your component
            </div>
        ))
      }
    </GridCarousel>
  

or visit https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--dots-enable

Hide custom scrollbar

To hide custom scrollbar pass customScrollbar prop as false customScrollbar={false}


import GridCarousel from '@yoge-shource/grid-carousel-react'

   In First Way
    
    <GridCarousel
      customScrollbar={false} // here
      itemComponent={CarouselItem} // your component
      carouselData={gridCarouselMockData}
    />
    
   // ---- OR ---- 
   In Second Way
    
    <GridCarousel
     customScrollbar={false} //here
     carouselData={gridCarouselMockData} >
      {
        gridCarouselMockData.length > 0 && 
          gridCarouselMockData.map((item, itemKey) => (
            <div className="carousel-item">
                <CarouselItem item={item}/> // your component
            </div>
        ))
      }
    </GridCarousel>
  

or visit https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--hide-custom-scrollbar

Custom Arrows

To Customize Arrows or to add own arrows, need to pass customArrows prop.

 import GridCarousel from '@yoge-shource/grid-carousel-react';
   
   import Arrow from '---your arrow---'
   
    First Way
    
    <GridCarousel
      itemComponent={CarouselItem} // your component
      carouselData={gridCarouselMockData}
      // --- here ---
      customArrows={{
          leftArrow: Arrows, // your Arrow component and do not <Arrow />
          leftArrowProps: {left:'right', square:'square'},  // your Arrow component props
          rightArrow: Arrows, // your Arrow component props
          rightArrowProps:{right:'right', square:'square'} // your Arrow component props
        }
      }
    />
    
    ---- OR ---- 
    Second Way
    
    <GridCarousel
      carouselData={gridCarouselMockData} 
      // --- here ---
      customArrows={{ // double braces important
          leftArrow: Arrows, // your Arrow component and do not <Arrow />
          leftArrowProps: {left:'right', square:'square', onClick:onClickHandler}, 
           // onClick: () => onClickHandler() ---- wrong---- 
            // onClick: onClickHandler---- right----
          rightArrow: Arrows,
          rightArrowProps:{right:'right', square:'square', onClick:onClickHandler}
        }} >
       {
        gridCarouselMockData.length > 0 && 
          gridCarouselMockData.map((item, itemKey) => (
            <div className="carousel-item">
                <CarouselItem item={item}/> // your component
            </div>
        ))
       }
    </GridCarousel>

or visit https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--custom-arrows

In side GridCarousel Above Arrow will render like this

      <Arrows right='right', square='square' onClick={()=>onClick()} />

Auto Play or Auto slide

In first way of integration, We need to pass itemComponent and carouselData as props to GridCarousel, then GridCarousel will take this component and loop this component using carouselData and while looping, GridCarousel will send item, ...otherprop as pops to itemComponent.

In This Way itemComponent and carouselData props are mandatory.

Autoplay will stop onHover of the GridCarousel


   import GridCarousel from '@yoge-shource/grid-carousel-react'
   
    First Way
    
    <GridCarousel
      autoPlay={true} //--- here--
      itemComponent={CarouselItem} // your component
      carouselData={gridCarouselMockData}
    />
    
    ---- OR ---- 
    Second Way
    
    <GridCarousel
      carouselData={gridCarouselMockData}
       autoPlay={true} //--- here--
      >
      {
        gridCarouselMockData.length > 0 && 
          gridCarouselMockData.map((item, itemKey) => (
            <div className="carousel-item">
                <CarouselItem item={item}/> // your component
            </div>
        ))
      }
    </GridCarousel>

or visit https://dvyogesh.github.io/lerna-starter/?path=/story/design-system-gridcarousel--auto-play-or-auto-slide

LICENSE

MIT