Usage
Nuka v8 and above are completely rewritten with new props and might not be completely backwards compatable with v7.
Installation
In the directory containing package.json, run your package manager's install command:
- npm
- Yarn
- pnpm
npm install nuka-carousel
yarn add nuka-carousel
pnpm add nuka-carousel
info
Nuka Carousel has a peer dependency on React 18.
Basic Usage
import { Carousel } from 'nuka-carousel';
const App = () => {
return (
<Carousel autoplay wrapAround showPageIndicators>
<div>Slide 1</div>
<div>Slide 2</div>
<div>Slide 3</div>
</Carousel>
);
};
Feel free to mix React components and HTML elements as children. Nuka Carousel will handle them all.
<Carousel>
<div>Slide 1</div>
<img src="/img/image3.png" />
<MyCustomComponent />
</Carousel>