cohan-react-scrollspy-ez
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i cohan-react-scrollspy-ez

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

62.9 kB

Total Files

8

Last publish

Collaborators

  • nahoc