
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
react-virtualized-sticky-tree
Advanced tools
A React component for efficiently rendering tree like structures with support for position: sticky
A React component for efficiently rendering tree like structures with support for position: sticky. react-virtualized-sticky-tree
uses a similar API to react-virtualized.
npm install react-virtualized-sticky-tree --save
import StickyTree from 'react-virtualized-sticky-tree';
const tree = {
root: { name: 'Root', children: ['child1', 'child2', 'child3'], depth: 0 },
child1: { name: 'Child 1', children: ['child4'], depth: 1 },
child2: { name: 'Child 2', depth: 2 },
child3: { name: 'Child 3', depth: 2 },
child4: { name: 'Child 4', depth: 3 },
};
const getChildren = (id) => {
return tree[id].children;
};
const rowRenderer = (id) => {
const node = tree[id];
return <div>{node.name}</div>
};
const getHeight = () => 30;
render(
<StickyTree
root="root"
getChildren={getChildren}
getHeight={getHeight}
rowRenderer={rowRenderer}
renderRoot={true}
overscanRowCount={20}
/>
);
If the containing element of your tree has a dynamic height, you can use react-measure to provide the width and height to sticky-tree so that it can resize to the available width.
npm install react-measure --save
const MeasuredTree = withContentRect('bounds')(({ measureRef, measure, contentRect }) => (
<div ref={measureRef} className="sticky-wrapper">
<StickyTree
root="root"
getChildren={getChildren}
getHeight={getHeight}
rowRenderer={rowRenderer}
renderRoot={true}
width={contentRect.bounds.width}
height={contentRect.bounds.height}
overscanRowCount={20}
/>
</div>
));
Rendering tree structures is supported in all modern browsers. position: sticky has only been tested in Chrome 59 and Firefox 54, but should work in Edge, Safari and Opera. See http://caniuse.com/#search=position%3Asticky
FAQs
A React component for efficiently rendering tree like structures with support for position: sticky
The npm package react-virtualized-sticky-tree receives a total of 1,411 weekly downloads. As such, react-virtualized-sticky-tree popularity was classified as popular.
We found that react-virtualized-sticky-tree 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.