Please help .I tried a lot but it's not working my requirement is to move the pagination outside of wherever i want but when i use padding or margin it's not working ..It always inside the slider if i forced to positioned outside of slider it's got hidden.
https://github.com/Sohit-Kumar/React-swiper-Pagination
import React from "react";
import SwiperCore, {
Navigation,
Pagination,
Scrollbar,
A11y,
Keyboard,
Mousewheel,
EffectCoverflow,
} from "swiper";
import { Swiper, SwiperSlide } from "swiper/react";
// Import Swiper styles
import "swiper/swiper.scss";
import "swiper/components/navigation/navigation.scss";
import "swiper/components/pagination/pagination.scss";
import "swiper/components/scrollbar/scrollbar.scss";
import "./Simple.css";
// install Swiper components
SwiperCore.use([
Navigation,
Pagination,
Scrollbar,
A11y,
Keyboard,
Mousewheel,
EffectCoverflow,
]);
const SimpleSwiper = () => {
const params = {
effect: "coverflow",
grabCursor: true,
centeredSlides: true,
slidesPerView: "auto",
coverflowEffect: {
rotate: 40,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows: true,
},
};
return (
<div className="swipebody">
<Swiper
{...params}
spaceBetween={50}
slidesPerView={5}
navigation
pagination={{
clickable: true,
renderBullet: (index, className) => {
return '<span class="' + className + '">' + (index + 1) + "</span>";
},
}}
keyboard={true}
mousewheel={true}
// scrollbar={{ draggable: true }}
>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
<SwiperSlide className="swiper-slide">
<img src="https://picsum.photos/id/237/250/200" />
</SwiperSlide>
</Swiper>
</div>
);
};
export default SimpleSwiper;
CSS
*{
margin: 0;
padding: 0;
box-sizing: border-box;
position: relative;
}
.swipebody{
margin-top: 50px;
width: 100%;
height: 100%;
position: relative;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
overflow: hidden;
}
.swiper-pagination {
bottom: -10px !important;
color: solid black;
background-color: black;
height: 20px;
}
.swiper-pagination-bullet{
background-color: darkorange;
}
.swiper-pagination-bullet-active {
background-color: rgb(255, 0, 43);
color: rgb(136, 255, 0);
}