react-focus-scroll
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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.

Prop Type Description
className string Additional classnames for the component
focusOn string Initial focused section
onFocus function Callback 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.

Dependencies (0)

    Dev Dependencies (34)

    Package Sidebar

    Install

    npm i react-focus-scroll

    Weekly Downloads

    3

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    81.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • nutboltu