React Smart Sections
Vertical scroll solution that follows what you actually read
Installation
yarn add react-smart-sections
npm install --save react-smart-sections
Documentation
import Fragment as 👻 from 'react';import Section from 'react-smart-sections'; const Page = <👻> <Section ="introduction"> <h1>Introductin</h1> <p>By default Section wraps content with a div</p> </Section> <Section ="chapterOne" ="section"> <h2>Chapter one</h2> <p>You can also provide component prop that specifies html tag rendered by Section</p> </Section> <Section ="chapterTwo" = /> </👻>;
import SectionsSpy from 'react-smart-sections'; const labels = introduction: "Introduction" chapterOne: "Chapter one" chapterTwo: "Chapter two"; const Navigation = <nav> <ul> <SectionsSpy = /> </ul> </nav>
import SectionSpy from 'react-smart-sections'; const Navigation = <nav> <ul> <SectionSpy ="introduction" = /> </ul> </nav>;