-
[Nextjs 스와이프] Swiper 사용Next.js 2022. 7. 23. 23:45728x90
https://swiperjs.com/get-started
Getting Started With Swiper
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
swiperjs.com
npm install swiperNext.js를 사용 하기 때문에 Swiper react 공식문서 참고
Swiper React Components
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
swiperjs.com
import { Swiper, SwiperSlide } from 'swiper/react'; import SwiperCore, { Autoplay } from 'swiper'; import 'swiper/css'; SwiperCore.use([Autoplay]); <Swiper slidesPerView={1} loop={true} autoplay={{ delay:2000 }} > <SwiperSlide>{Slide()}</SwiperSlide> <SwiperSlide>{Slide()}</SwiperSlide> <SwiperSlide>{Slide()}</SwiperSlide> <SwiperSlide>{Slide()}</SwiperSlide> </Swiper>Next.js typescript를 사용 하고 있어서 뭔가 설정 더 해줘야 될줄 알았지만, 공식 문서대로 하면 됨.
728x90'Next.js' 카테고리의 다른 글
Nextjs에서 Nestjs로 accessToken header로 요청할때 오류 (0) 2022.12.26 Recoil, react-query 로그인 오류 (0) 2022.12.24 [Nextjs]SSG,SSR react-query로 Dynamic Routes에 적용 (0) 2022.12.22 [Nextjs]상태관리 (2) 2022.12.22 [Nextjs 시작] (0) 2022.07.19