
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-lazy-tree
Advanced tools
Recursively render tree data structures.
Control tree node markup, content and style.
Render lazily or greedily.
Specify vertical animation, CSS classes, initial active node, and more.
Please see demo site and example code.
npm install --save react-lazy-tree
import ReactLazyTree from 'react-lazy-tree'
...
<ReactLazyTree {...{
data: tree,
mapInitialActiveNode: (node) => {
return node.label === 'Dresses';
},
mapListClassName: ({ depth }) => {
const exampleDepth = `example--depth-${depth}`;
return `example ${exampleDepth}`;
},
mapListItemClassName: ({ isOnActivePath }) => {
const modifier = isOnActivePath ? 'expanded' : 'contracted';
const nodeIcon = `example__node--${modifier}`;
return `example__node ${nodeIcon}`;
},
mapNodeContent: ({ depth, isActiveNode }) => {
const labelDepth = `example__label--${depth}`;
const isActive = isActiveNode ? 'example__label--active' : '';
const className = `example__label ${labelDepth} ${isActive}`;
return (
<Label {...{
className,
text: node.label
}}/>
);
},
onActiveNodeChanged: activeNodeChangedHandler
}}/>
data
- Tree data structure, or a collection of tree data structures.
mapNodeContent
- Specify content, markup, and style for tree node presentation.
depth
: Numberindex
: NumberisActiveNode
: BooleanisLeafNode
: BooleanisOnActivePath
: Booleannode
: ObjectchildrenPropertyName
- Specify data node children property name.
children
mapListClassName
- Specify HTML list (UL) class names.
depth
: NumberisOnActivePath
: Booleannode
: ObjectmapListItemClassName
- Specify HTML list-item (LI) class names.
depth
: NumberisActiveNode
: BooleanisLeafNode
: BooleanisOnActivePath
: Booleannode
: ObjectmapInitialActiveNode
- Specify a node that should be active initially.
node
: ObjectonActiveNodeChanged
- Handle active node changes as a result of user interaction.
activePath
: Stringdepth
: Numbere
: Objectindex
: Numbernode
: ObjectinteractiveStartDepth
- Specify at what depth the rendered tree should become interactive.
-1
.shouldLazyRender
- Specify should tree nodes be rendered when becoming visible or at mount time.
shouldShowAllNodes
- Specify the entire tree should be rendered initially.
shouldLazyRender
and mapInitialActiveNode
verticalAnimationConfig
- Specify CSS transition duration and timing.
durationInMs
: Numbertiming
: Keyword | FunctiondurationInMs
: 300timing
: ease-inPlease open an issue.
git clone https://github.com/ethanselzer/react-lazy-tree.git
cd react-lazy-tree
npm install
See available commands:
npm run
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.
FAQs
A React Treeview Component
The npm package react-lazy-tree receives a total of 7 weekly downloads. As such, react-lazy-tree popularity was classified as not popular.
We found that react-lazy-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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.