Skip to content

Repository files navigation

React Focus on Scroll

dependencies StatusBuild Statussemantic-release

A react component which focuses sections while scrolling

See Demo and Documentation.

Props

The component takes the followin props.

PropTypeDescription
classNamestringAdditional classnames for the component
focusOnstringInitial focused section
onFocusfunctionCallback function to invoke when a section is focues The function should contain one parameter(focusIndex).

Installation

npm install react-focus-scroll --save

Usage

importFocusOnScrollfrom"react-focus-scroll";<FocusOnScrollfocusOn="1"onFocus={onFocus}classNames="custom-class"><div>This is first section</div><div>This is second section</div></FocusOnScroll>

License

MIT Licensed. Copyright (c) Farhad Yasir 2019.

About

A react component which focuses sections while scrolling. For demo visit here https://nutboltu.github.io/react-focus-scroll

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages