Introduction
Small, fast, and accessibility-first React carousel library with easily customizable UI and behavior to fit your brand and site.
Demo
Nuka Carousel accepts any React component as children, and will render them as slides. Here's a basic example:
Basic Code
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>
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.