Swiper Grid, Auto SlidesPerView & rows? #5661
Unanswered
ivanjeremic
asked this question in
Q&A
Replies: 1 comment
-
same issue did you find any solution? to the dynamic slidesperview based on width of screen? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm very interested in using Swiper Grid Example(react) for my App, I forked the Example from codesandbox https://codesandbox.io/s/swiper-slides-grid-react-forked-2c0041?file=/src/App.jsx and played around and I need to tweak a few things which is harder than I thought, The first problem I want to solve is the
Swiper
decides how manySwiperSlide
's to show on one page based on how manyslidesPerView
there are, what I want is to calculate theslidesPerView
dynamically based on the current size of the window, that means if currently 6 slides can fit on one page there should be less pages and when the user makes the window smaller or is on mobile there should be more pages.The second problem which is the same but for
rows
is that the slides change the width & height and become bigger when the window width or height changes, what I want is perfectly square sizeSwiperSlide
's the size of the slide should be calculated based on how many rows/slidesPerView there could be but other than in the example the slides should stay on top no matter what height or width I give to theSwiper
itself andflex-wrap
when more slides are added.Beta Was this translation helpful? Give feedback.
All reactions