1.0.2 • Published 5 years ago

react-scrollspy-ez v1.0.2

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

react-scrollspy-ez

simple scrollspy component for react

NPM JavaScript Style Guide

Demo

here

Install

npm install --save react-scrollspy-ez

Usage

import * as React from "react";

import Scrollspy from "react-scrollspy-ez";

class Example extends React.Component {
  render() {
    return <Scrollspy ids={["one", "two"]} />;
  }
}

Options

  • ids - dom id of the page element to track
  • offset - scroll offset (in pixels), if your page elements have lots of padding. Default is 2.
  • itemContainerClassName - class for the whole scrollspy menu
  • activeItemClassName - class for the active menu item
  • containerElement - a JSX element for the whole menu (default is ul)
  • itemElement - a JSX element for each menu item, default is li

License

MIT © telega