1.0.7 • Published 4 years ago
click-and-scroll v1.0.7
Click and Scroll
click-and-scroll is a react component that changes active tab depending on scroll position but also responds to clicking.
Installation
npm install click-and-scroll
Usage
Pass content you want to display as a react component and title os section as a string
import { ClickAndScroll } from 'click-and-scroll';
const Content = () => {
return (
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.'
</p>
);
};
<ClickAndScroll
sections={[
{
title: 'TEST 1',
component: Content
},
{
title: 'Test 2',
component: Content
},
{
title: 'TEST 3',
component: Content
}
]}
/>