1.0.4 • Published 5 years ago
cohan-react-scrollspy-ez v1.0.4
react-scrollspy-ez
simple scrollspy component for react
Demo
Install
npm install --save react-scrollspy-ezUsage
import * as React from "react";
import Scrollspy from "react-scrollspy-ez";
class Example extends React.Component {
render() {
return <Scrollspy ids={["one", "two"]} />;
}
}Options
ids- domidof the page element to trackoffset- scroll offset (in pixels), if your page elements have lots of padding. Default is2.itemContainerClassName- class for the whole scrollspy menuactiveItemClassName- class for the active menu itemcontainerElement- a JSX element for the whole menu (default isul)itemElement- a JSX element for each menu item, default isli
License
MIT © telega