React Carousel Hook Example Save

Example for creating a carousel component based on the useCarousel hook.

Project README

react-carousel-hook-example

This is a sample implementation using the useCarousel hook as described in my article at LogRocket.

Building

If you have Node with NPM installed you can just install the local dependencies after cloning:

npm install

then you can run the local dev server using:

npm start

This will start the dev server at localhost:1234.

Structure

The source code is contained in the src folder. useCarousel.ts has the code mentioned in the article, while DemoCarousel has a carousel component using this hook. This sample uses emotion for styling - so all the CSS is inlined.

The app.tsx hosts the application. It creates an instance of teh DemoCarousel component just rotating three placeholder images.

License

This sample code is released using the MIT license. For more information see the LICENSE file.

Open Source Agenda is not affiliated with "React Carousel Hook Example" Project. README Source: FlorianRappl/react-carousel-hook-example

Open Source Agenda Badge

Open Source Agenda Rating