
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-smart-sections
Advanced tools
Vertical scroll solution that follows what you actually read
yarn add react-smart-sections
npm install --save react-smart-sections
import { Fragment as 👻 } from 'react';
import { Section } from 'react-smart-sections';
export const Page = () => (
<👻>
<Section name="introduction">
<h1>Introductin</h1>
<p>By default Section wraps it's content with a div</p>
</Section>
<Section name="chapterOne" component="section">
<h2>Chapter one</h2>
<p>You can also provide component prop that specifies html tag rendered by Section</p>
</Section>
<Section name="chapterTwo" render={(handleRef) => (
<YourWrapperComponent ref={handleRef}>
<h2>Chapter two</h2>
<p>You can also use your wrapping component as long as you provide a reference to a rendered DOM element</p>
</YourWrapperComponent>
)} />
</👻>
);
import { SectionsSpy } from 'react-smart-sections';
const labels = {
introduction: "Introduction",
chapterOne: "Chapter one",
chapterTwo: "Chapter two",
};
export const Navigation = () => (
<nav>
<ul>
<SectionsSpy render={(sections) => (
{sections.map(section => (
<li key={section.name} className={section.active ? "active" : null}>
<a href="#" onClick={section.scroll}>{labels[section.name]}</a>
</li>
))}
)} />
</ul>
</nav>
)
import { SectionSpy } from 'react-smart-sections';
export const Navigation = () => (
<nav>
<ul>
<SectionSpy
name="introduction"
render={section => (
<li className={section.active ? 'active' : null}>
<a href="#" onClick={section.scroll}>
Introduction
</a>
</li>
)}
/>
</ul>
</nav>
);
FAQs
Vertical scroll solution that follows what you actually read
The npm package react-smart-sections receives a total of 212 weekly downloads. As such, react-smart-sections popularity was classified as not popular.
We found that react-smart-sections demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.