Full page scrolling with React
npm install react-full-page-debounce
``js
import React from 'react';
import { FullPage, Slide } from 'react-full-page-throttle';
export default class FullPageExample extends React.Component {
render() {
return (
Inner slide content
Another slide content
);
}
});
`
* initialSlide defaults to 0duration
* - scroll duration [ms] defaults to 700controls
* defaults to falsetrue
* adds built-in controlscontrolsProps
* Pass React component if you want to use your own controls
* additional props for controls componentbeforeChange
* callback executed before scrollafterChange
* callback executed after scrollscrollMode
* full-page or normal - defaults to full-page
Both beforeChange and afterChange will receive as parameter an object like:
`js`
{
"from": 0, // the index of the slide react-full-page is scrolling _from_
"to": 1, // the index of the slide react-full-page is scrolling _to_
}
Basic controls props (passed automatically)
`js`
getCurrentSlideIndex: PropTypes.func.isRequired,
onNext: PropTypes.func.isRequired,
onPrev: PropTypes.func.isRequired,
scrollToSlide: PropTypes.func.isRequired,
slidesCount: PropTypes.number.isRequired,`
Default controls examplejs`
...
Custom controls example
`js``
...