JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/carousel/carousel.css"
/>
<style>
#myCarousel {
--f-carousel-spacing: 10px;
--f-carousel-slide-width: 100%;
--f-transition-duration: 2s;
}
#myCarousel .f-carousel__slide {
padding: 50px;
background: #eee;
}
</style>
</head>
<body>
<div>
<div class="f-carousel" id="myCarousel">
<div class="f-carousel__slide">1</div>
<div class="f-carousel__slide">2</div>
<div class="f-carousel__slide">3</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/carousel/carousel.umd.js"></script>
<script>
const container = document.getElementById("myCarousel");
new Carousel(container, {
//
});
</script>
</body>
</html>