import { Swiper, SwiperSlide } from 'swiper/react'; import { Navigation } from 'swiper/modules'; import 'swiper/css'; import 'swiper/css/navigation'; import 'swiper/css/pagination'; import './index.css'; // Assuming you have your styles in a separate CSS file
const SwiperCarousel = () => { return ( <div className='category-slider'> <Swiper modules={[Navigation]} onSwiper={(swiper) => console.log(swiper)} onSlideChange={() => console.log('slide change')} spaceBetween={25} slidesPerView={5} navigation={{ nextEl: '.review-swiper-button-next', prevEl: '.review-swiper-button-prev', }} > <SwiperSlide> <div className="category-card"> <img src="https://clicon-html.netlify.app/image/product/product-14.png" alt="" className='category-image' /> <h6 className="category-text">TV & Homes</h6> </div> </SwiperSlide> <SwiperSlide> <div className="category-card"> <img src="https://clicon-html.netlify.app/image/product/product-12.png" alt="" className='category-image' /> <h6 className="category-text">Accessories</h6> </div> </SwiperSlide> <SwiperSlide> <div className="category-card"> <img src="https://clicon-html.netlify.app/image/product/product-9.png" alt="" className='category-image' /> <h6 className="category-text">Computer & Laptop</h6> </div> </SwiperSlide> <SwiperSlide> <div className="category-card"> <img src="https://clicon-html.netlify.app/image/product/product-14.png" alt="" className='category-image' /> <h6 className="category-text">TV & Homes</h6> </div> </SwiperSlide> <SwiperSlide> <div className="category-card"> <img src="https://clicon-html.netlify.app/image/product/product-12.png" alt="" className='category-image' /> <h6 className="category-text">Accessories</h6> </div> </SwiperSlide> <SwiperSlide> <div className="category-card"> <img src="https://clicon-html.netlify.app/image/product/product-9.png" alt="" className='category-image' /> <h6 className="category-text">Computer & Laptop</h6> </div> </SwiperSlide> </Swiper> <button className="slick-arrow-carousel button-prev review-swiper-button-prev" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M20.25 12H3.75" stroke="white" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path> <path d="M10.5 5.25L3.75 12L10.5 18.75" stroke="white" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path> </svg> </button> <button className="slick-arrow-carousel button-next review-swiper-button-next" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M3.75 12H20.25" stroke="white" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path> <path d="M13.5 5.25L20.25 12L13.5 18.75" stroke="white" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path> </svg> </button> </div> ); }
export default SwiperCarousel; |