Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
How to add Pagination to Swiper carousel in a React app?

I use "swiper": "6.8.4" in React app and create carousel. Everything is working, except pagination - its not appearing on the page. Do you see what I do in a wrong way?

swiper pagination api docs

...
function Carousel() {
  return (
      <Swiper
        
        modules={[EffectFade, Keyboard, Pagination, Autoplay]}
        pagination={{
          el: '.swiper-pagination',
          type: 'bullets',
        }}

        effect={'fade'}
        fadeEffect={{crossFade: true}}
        freeMode={true}
        autoplay={{
          delay: 2500,
          disableOnInteraction: false,
        }}
        keyboard={{
          enabled: true,
          onlyInViewport: true,
          onPageUp: true,
        }}
        className="mySwiper"
        cssMode={true}
        loop={false}
        mousewheel={true}
        slidesPerView={1}
      >
        <SwiperSlide>0</SwiperSlide>
        <SwiperSlide>1</SwiperSlide>
      </Swiper>
  )
}

export default Carousel

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I want to share that we must be aware of how we import Swiper into our React apps.

In my case, I finally changed the Swiper version to "swiper": "8.1.4". Then I imported it like:

import {Swiper, SwiperSlide} from 'swiper/react/swiper-react'

and it started to work.

Swiper NPM package is now a pure ESM package. Which means it doesn't have CommonJS modules anymore (the ones with require() and module.exports syntax) and contains only native ES modules. If your bundler/tooling/environment doesn't support Node ES module, you should update it or stay on Swiper 6.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda