UNPKG

react-full-page-scroll

Version:

Component for creating one page vertical scroll.

47 lines (31 loc) 905 B
# React One Page Scroll Component for creating one page vertical scroll. <b>Install</b> ``` $ npm install react-full-page-scroll ``` <b>Run</b> ``` $ npm install ``` <b>Usage</b> ```js import React from "react"; import ScrollableContainer from "react-full-page-scroll"; function PageComponent = ({children}) => { return (<div>{children}</div>) } function App() { return ( <ScrollableContainer animationTime={2000}> <PageComponent>Page One</PageComponent> <PageComponent>Page Two</PageComponent> <PageComponent>Page Three</PageComponent> </ScrollableContainer> ); } export default App; ``` <b>Props / Options</b> - animationTime - Time it takes to do scrolling animation in miliseconds (defaults is 1000 miliseconds) note: we do a scroll locking to prevent user from scrolling when animation is working. the locking time was `animationTime` + 500 miliseconds