swiper
swiper copied to clipboard
Add "peek" parameter to show part of the previous and next slide
Clear and concise description of the problem
As a developer using Swiper I want to have peek option so I can show the part of the previous and next slide.
Glide.js has this feature:
https://glidejs.com/docs/options/
Suggested solution
Add peek parameter.
Alternative
No response
Additional context
I don't understand why such a comprehensive like Swiper.js does not have this commonly-used feature.
Validations
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Would you like to open a PR for this feature?
- [ ] I'm willing to open a PR
you can use float value with slidePerView e.g : slidePerView: 2.5
@vltansky Thanks. This is working :) However, using this solution I cannot show the part of the previous slide. I can only show part of the next slide.
Try centeredSlides https://swiperjs.com/swiper-api#param-centeredSlides
How can I disable this option? I don't want to show part of next slide, but it is showing. Slidesperview is set to 1, effect used is 'slide'.
@vltansky
"I have set spaceBetween={10}, freeMode={true}, and slidesPerView={2.1} as I want 2 slides to be shown as a default. I want 10% of the third slide to be visible on both sides. However, by setting slidesPerView={2.1}, I am able to see the 10% of the slide on the right-hand side but not on the left-hand side. How can I achieve this?"