1.1.1 • Published 5 years ago

react-focus-scroll v1.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

React Focus on Scroll

dependencies Status Build Status semantic-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

import FocusOnScroll from "react-focus-scroll";

<FocusOnScroll
  focusOn="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.