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

1.0.2 • 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 react-scrollspy-ez

Weekly Downloads

15

Version

1.0.2

License

MIT

Unpacked Size

56.3 kB

Total Files

9

Last publish

Collaborators

  • telega