Swiper를 먼저 받아야 한다.
import React from 'react';
import { Swiper, SwiperSlide } from 'swiper/react';
import 'swiper/css';
import 'swiper/css/pagination';
import { Pagination } from 'swiper/modules';
export default function App() {
return (
<div style={{ height: '50vh', position: 'relative', background: 'white', fontSize: '52px', color: '#000', margin: '0', padding: '0' }}>
<Swiper
pagination={true}
modules={[Pagination]}
style={{ width: '100%', height: '100%' }}
>
<SwiperSlide
style={{
textAlign: 'center',
fontSize: '52px',
background: '#fff',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor:"pink"
}}
>
Slide 1
</SwiperSlide>
<SwiperSlide
style={{
textAlign: 'center',
fontSize: '52px',
background: '#fff',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor:"skyblue"
}}
>
Slide 2
</SwiperSlide>
<SwiperSlide
style={{
textAlign: 'center',
fontSize: '52px',
background: '#fff',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor:"lightgray"
}}
>
Slide 3
</SwiperSlide>
<SwiperSlide
style={{
textAlign: 'center',
fontSize: '52px',
background: '#fff',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor:"yellowgreen"
}}
>
Slide 4
</SwiperSlide>
<SwiperSlide
style={{
textAlign: 'center',
fontSize: '52px',
background: '#fff',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
backgroundColor:"cyan"
}}
>
Slide 5
</SwiperSlide>
</Swiper>
</div>
);
}
'업무 회고' 카테고리의 다른 글
2025년 2월 개발 회고 (0) | 2025.03.04 |
---|---|
react-progress-bar로 프로그레스 바 만들기 (0) | 2025.03.04 |
keyframes로 자동으로 움직이는 Carousel 만드는 법 (0) | 2025.03.02 |
순수 CSS로만 Sticky Scroll Cards 만들기 (0) | 2025.03.01 |
QRCode 라이브러리 불러와서 QR코드 만들기 (0) | 2025.02.28 |
댓글