Swiper React custom navigation components
See original GitHub issueThis is a:
-
bug
-
enhancement
-
feature-discussion (RFC)
-
Swiper Version: swiper@6.0.1.
-
Live Link or JSFiddle/Codepen or website with isssue: PREFERABLY (IF YOU WANT YOUR ISSUE TO BE RESOLVED ASAP).
What you did
I set navigation property
<Swiper navigation={{ navigation: { nextEl: (<div className='next'></div>), prevEl: (<div className='next'></div>) }}> ... </Swiper>
Expected Behavior
I want to see my own navigation buttons
Actual Behavior
The navigation isn’t there, nither the original. It’s like “navigation: false”.
Thanks in advance
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Swiper React | How to create custom navigation/pagination ...
Thank you for this. I was wondering if there is a way to get the swiper instance at the root component like this....
Read more >[swiper/react] Custom navigation/pagination components ...
SwiperJS documentation states that navigation prevEl/nextEl can either be of type "string" or "HTMLElement". Using HTML nodes allows for ...
Read more >react-swiper-navigation - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >Swiper React Components
Note, Swiper React component will create required elements for Navigation, Pagination and Scrollbar if you pass these params without specifying its elements ......
Read more >How to Customize Prev/Next Buttons in React SwiperJs
How to Customize Prev/Next Buttons in React SwiperJs · 1. Change Color of Swiper Arrows · 2. Replace Image of Swiper Arrows.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As to documentation nextEl and prevEl receive HTMLElement or string with CSS selector, so it should be:
@awt0523 If you check the Typescript interface from navigation, it can receives an object with nextEl and prevEl and both can receive a CSSSelector or HTMLElement and yeah, for some reason they aren’t showing.
@MacGyver98 To get around this, I ended up creating a useRef in the swipe to access the slideNext and slidePrev methods, here’s an example.