skip to Main Content

I’m building a carousel for my portfolio using the react-responsive-carousel npm package. I’m having a hard time passing the props to the Carousel itself. I followed the examples and I’m not getting any errors but they aren’t being applied. Any tips?
Thank you in advance!

import { Carousel } from 'react-responsive-carousel';
import 'react-responsive-carousel/lib/styles/carousel.min.css';
<Carousel swipeable={true} showThumbs={false} stopOnHover={true} autoPlay={true} transitionTime={500} className="carousel">

I’ve tried changing around the props, trying to import the props directly and changing them into quotes. I’m lost.

2

Answers


  1. You just have to put some elements inside the carousel as slides.

    Login or Signup to reply.
  2. hope it helps you

      <Carousel autoPlay={true}>
        <div>
          <img src="assets/1.jpeg" />
          <p className="legend">Legend 1</p>
        </div>
        <div>
          <img src="assets/2.jpeg" />
          <p className="legend">Legend 2</p>
        </div>
        <div>
          <img src="assets/3.jpeg" />
          <p className="legend">Legend 3</p>
        </div>
      </Carousel>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search