0.0.3 • Published 7 months ago

yozm-cafe-react-scroll-snap v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

react-scroll-snap

Scroll snap의 동작을 React 상에서 구현한 라이브러리입니다.

현재 제한적인 케이스에서만 사용을 지원합니다.

  • 리스트 아이템이 height: 100% 이어야 한다

Getting Started

npm install react react-dom styled-components

이 라이브러리를 사용하는 데에 필요한 peer dependency들을 설치해줍니다.

npm install @solo5star/react-scroll-snap
const items = [
   { color: 'red' },
   { color: 'orange' },
   { color: 'yellow' },
];

<ScrollSnapProvider items={items} itemRenderer={(item) => <div>{item.color}</div>}>
  <ScrollSnap mode="impl" style={{ width: '300px', height: '500px' }} />
</ScrollSnapProvider>
0.0.3

7 months ago