simple scrollspy component for react
npm install --save react-scrollspy-ez
import * as React from "react";
import Scrollspy from "react-scrollspy-ez";
class Example extends React.Component {
render() {
return <Scrollspy ids={["one", "two"]} />;
}
}
-
ids
- domid
of the page element to track -
offset
- scroll offset (in pixels), if your page elements have lots of padding. Default is2
. -
itemContainerClassName
- class for the whole scrollspy menu -
activeItemClassName
- class for the active menu item -
containerElement
- a JSX element for the whole menu (default isul
) -
itemElement
- a JSX element for each menu item, default isli
MIT © telega