React Responsive Carousel

3.2.23 · maintenance · verified Sun Apr 19

React Responsive Carousel is a powerful and highly customizable carousel component for React applications, currently at version 3.2.23. It offers responsive design, mobile-friendly swipe gestures, server-side rendering compatibility, and keyboard navigation. Developers can customize animation duration, enable auto-play with custom intervals, and configure infinite loops in both horizontal and vertical directions. A key differentiator is its flexibility, supporting various content types like images, videos, and text as direct children, along with extensive customization options for thumbs, arrows, indicators, status displays, and animation handlers. However, the package is currently in a maintenance-only state, as the primary maintainer lacks time for active development. New features are not being added, though safe pull requests might be merged occasionally, implying an infrequent release cadence focused primarily on stability rather than feature expansion.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates basic usage of the Carousel component with three image slides and associated legends, including the mandatory CSS import.

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import "react-responsive-carousel/lib/styles/carousel.min.css"; // mandatory styles
import { Carousel } from 'react-responsive-carousel';

class DemoCarousel extends Component {
    render() {
        return (
            <Carousel>
                <div>
                    <img src="https://via.placeholder.com/600x400?text=Image+1" alt="Legend 1" />
                    <p className="legend">Legend 1</p>
                </div>
                <div>
                    <img src="https://via.placeholder.com/600x400?text=Image+2" alt="Legend 2" />
                    <p className="legend">Legend 2</p>
                </div>
                <div>
                    <img src="https://via.placeholder.com/600x400?text=Image+3" alt="Legend 3" />
                    <p className="legend">Legend 3</p>
                </div>
            </Carousel>
        );
    }
}

// Assuming a div with class 'demo-carousel' exists in your HTML
ReactDOM.render(<DemoCarousel />, document.querySelector('.demo-carousel'));

view raw JSON →