-
React) Swiper 사용하기Programing Language/React.js 2022. 5. 27. 16:20728x90반응형
package.json --- "swiper": "^6.8.4",
Main.tsx import { Swiper, SwiperSlide } from 'swiper/react'; import SwiperCore, { Navigation, Pagination } from "swiper"; import "swiper/swiper.scss"; import "swiper/components/navigation/navigation.scss"; import "swiper/components/pagination/pagination.scss"; SwiperCore.use([Navigation, Pagination]) export default function Main() { return( <div> <Swiper className="banner" spaceBetween={50} slidesPerView={1} navigation pagination={{ clickable: true }} > <SwiperSlide>Slide 1</SwiperSlide> <SwiperSlide>Slide 2</SwiperSlide> <SwiperSlide>Slide 3</SwiperSlide> <SwiperSlide>Slide 4</SwiperSlide> </Swiper> </div> ) }
참고 https://developer0809.tistory.com/94
개발자에게 에너지를 공급해주세요!! 하단 광고 클릭!!
728x90반응형'Programing Language > React.js' 카테고리의 다른 글
Recoil) Atom Effects에서 isReset 값 false 로 실행하기 (0) 2022.11.15 Recoil) Expectation Violation: Duplicate atom key "". This is a FATAL ERROR in 해결하기 (0) 2022.11.14 NextJS ) next js websocket.js?a9be:45 WebSocket connection to (0) 2022.09.29 React) 브라우저의 변하는 width, height를 Hook으로 전달받기 (0) 2022.06.23 React.js) FilePond 다루기(파일 업로드 모듈) (0) 2022.05.05