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

kedo-react-carousel

v1.0.7

Published

A responsive, touch-enabled carousel component for React with Next.js support

Readme

🎠 Kedo React Carousel

npm version Test Coverage codecov License: MIT Downloads

A responsive, touch-enabled carousel component for React with Next.js support and comprehensive test coverage.

✨ Features

  • 📱 Responsive Design - Adapts to different screen sizes
  • 👆 Touch/Swipe Support - Mobile-friendly touch gestures
  • ⚡ Next.js Compatible - SSR support out of the box
  • 🎯 Auto Play - Optional automatic slide progression
  • 🎨 Customizable - Custom navigation buttons and dots
  • 🧪 Well Tested - 80%+ test coverage
  • 📦 Lightweight - Minimal dependencies
  • ♿ Accessible - ARIA compliant

📊 Test Coverage

Our carousel component is thoroughly tested with comprehensive unit tests:

| Metric | Coverage | |--------|----------| | Statements | 85%+ | | Branches | 80%+ | | Functions | 90%+ | | Lines | 85%+ |

🚀 Installation

npm install kedo-react-carousel

📖 Usage

Basic Usage

import React from 'react';
import Carousel from 'kedo-react-carousel';

function App() {
  return (
    <Carousel>
      <div>Slide 1</div>
      <div>Slide 2</div>
      <div>Slide 3</div>
    </Carousel>
  );
}

Advanced Usage

import React from 'react';
import Carousel from 'kedo-react-carousel';

function App() {
  const handleSlideChange = (slideIndex, direction) => {
    console.log(`Moved to slide ${slideIndex} via ${direction}`);
  };

  return (
    <Carousel
      slidesToShow={3}
      slidesToScroll={1}
      autoPlay={true}
      autoPlayTimer={3000}
      pauseOnHover={true}
      showDots={true}
      responsive={[
        {
          breakpoint: 768,
          settings: {
            slidesToShow: 2,
            slidesToScroll: 1
          }
        },
        {
          breakpoint: 480,
          settings: {
            slidesToShow: 1,
            slidesToScroll: 1
          }
        }
      ]}
      onSlideChange={handleSlideChange}
    >
      <div>Slide 1</div>
      <div>Slide 2</div>
      <div>Slide 3</div>
      <div>Slide 4</div>
      <div>Slide 5</div>
    </Carousel>
  );
}

🔧 Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | children | ReactNode | - | Slides content | | slidesToShow | number | 1 | Number of slides to show | | slidesToScroll | number | 1 | Number of slides to scroll | | autoPlay | boolean | false | Enable auto play | | autoPlayTimer | number | 1000 | Auto play interval (ms) | | pauseOnHover | boolean | false | Pause auto play on hover | | showDots | boolean | false | Show navigation dots | | responsive | ResponsiveSettings[] | [] | Responsive breakpoints | | nextButton | ReactElement | - | Custom next button | | prevButton | ReactElement | - | Custom prev button | | dotComponent | ComponentType<DotProps> | - | Custom dot component | | onSlideChange | function | - | Slide change callback |

🧪 Testing

Run the test suite:

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in CI mode
npm run test:ci

# Generate test report
npm run test:report

Test Structure

Our test suite covers:

  • ✅ Component Rendering - Ensures all components render correctly
  • ✅ Navigation Logic - Tests next/prev button functionality
  • ✅ Auto Play - Validates automatic slide progression
  • ✅ Touch/Swipe - Tests mobile touch interactions
  • ✅ Responsive Behavior - Validates breakpoint handling
  • ✅ Custom Components - Tests custom button and dot components
  • ✅ Edge Cases - Handles empty slides, single slides, etc.
  • ✅ Cleanup - Ensures proper cleanup of timers and listeners

📈 Quality Metrics

  • Test Coverage: 85%+ overall coverage
  • Code Quality: ESLint compliant
  • Performance: Optimized for minimal re-renders
  • Accessibility: ARIA compliant navigation
  • Browser Support: Modern browsers + IE11

🔄 CI/CD Pipeline

Our package includes automated testing and publishing:

GitHub Actions Workflows

  1. Test Workflow (.github/workflows/test.yml)

    • Runs on Node.js 16.x, 18.x, 20.x
    • Executes full test suite
    • Generates coverage reports
    • Uploads to Codecov
    • Comments coverage on PRs
  2. Publish Workflow (.github/workflows/publish.yml)

    • Triggers on GitHub releases
    • Runs tests before publishing
    • Publishes to NPM automatically
    • Updates release with publish status

Setting Up CI/CD

  1. Add NPM Token: Add NPM_TOKEN to GitHub repository secrets
  2. Enable Codecov: Connect your repository to Codecov
  3. Configure Badges: Update badge URLs in README

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for your changes
  4. Ensure tests pass (npm test)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/ppuneet64/kedo-react-carousel.git

# Install dependencies
npm install

# Run tests
npm test

# Build the package
npm run build

# Run example
npm run dev

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • React team for the amazing framework
  • Testing Library for excellent testing utilities
  • All contributors who help improve this package

Made with ❤️ by Puneet Pandey