npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-vt-tree

v0.2.8

Published

...

Downloads

67

Readme

= react-vt-tree

Super fast virtulized tree of your dreams!

image:https://img.shields.io/npm/v/react-vt-tree.svg?style=for-the-badge[NPM registry,link=https://yarnpkg.com/en/package/react-vt-tree] image:https://img.shields.io/badge/license-mit-red.svg?style=for-the-badge[NPM license]

== Demo

Here is an link:https://avin.github.io/react-vt-tree[examples page]

== Install

# Yarn
yarn add react-vt-tree

# NPM
npm install --save react-vt-tree

== Features

  • :zap: Super mega fast! It's based on super fast virtulized-lists library link:https://github.com/bvaughn/react-window[react-window]
  • :art: Super customizable! Any components, any classNames, any styles for ALL included elements!
  • :hamburger: Content structure INDEPENDENT! Write your personal selectors to get children and expanded statuses! You can use flat or structured data arrays or link:https://facebook.github.io/immutable-js[Immutable.js] iterable constructions.

== Usage

See source code of examples link:./storybook[here]

== API

=== NodeParams properties

[cols="2,2,5",options="header"] |=========================================== | Property | Type | Description | node | any | Node data object | depth | number | Depth of node | hasChildren | boolean | Has children sign | isExpanded | boolean | Is expanded sign | index | number | Index of node | additionalData | Any | Additional data |===========================================

=== properties

[cols="2,2,^2,5",options="header"] |=========================================== | Property | Type | Required? | Description

| width | Number | ✓ | Width of tree container.

| height | Number | ✓ | Height of tree container.

| nodes | Iterable object | ✓ | Tree node-items.

| isNodeExpandedSelector | Function | ✓ | Selector to get expanded status of node item.

| nodeChildrenSelector | Function | ✓ | Selector to get child-nodes.

| hasChildrenSelector | Function | | Selector to determine children presence. You can skip this selector, so the result of nodeChildrenSelector will be used, but some times it's better to use if nodeChildrenSelector is slow to get more performance boost

| nodeContentSelector | Function | ✓ | Node's content selector.

| firstLevelNodesSelector | Function | ✓ | Selector to get first level items (with no parents).

| levelPadding | number | | Padding-left of 1x depth level. Default: 22

| noExpanderSpaceWidth | number | | Blank space width when there is no expander. Default: 25

| nodeClassName | string or Function | | Node optional className string or generate function. Function arguments: (NodeParams)

| nodeStyle | Object or Function | | Node optional style object or generate function. Function arguments: (NodeParams)

| nodeContentClassName | string or Function | | Node content optional className string or generate function. Function arguments: (NodeParams)

| nodeContentStyle | Object or Function | | Node content optional style object or generate function. Function arguments: (NodeParams)

| onNodeClick | Function | | On node click handler. Function arguments: (NodeParams)

| onNodeCollapse | Function | | On node collapse handler. Function arguments: (NodeParams)

| onNodeContextMenu | Function | | On node context menu handler. Function arguments: (NodeParams)

| onNodeDoubleClick | Function | | On node double click handler. Function arguments: (NodeParams)

| onNodeExpand | Function | | On node expand handler. Function arguments: (NodeParams)

| nodeExpanderComponent | Function | | Node Expander component.

| nodeContentComponent | Function | | Node content component.

| itemHeight | number | | Height of tree row. Default: 25

| onScroll | Function | | On scroll tree list handler.

| className | string | | Optional class name tree-list.

| style | Object | | Optional CSS style object for tree-list.

| initialScrollOffset | number | | Scroll offset for initial tree list render.

| listProps | Object | | Any other react-window list props. See https://react-window.now.sh/#/api/FixedSizeList for more info.

| additionalData | Any | | Additional data for NodeParams;

|===========================================

=== Properties passing to nodeExpanderComponent

[cols="2,2,^2,5",options="header"] |=========================================== | Property | Type | Required? | Description 4+| ... Includes all fields of NodeParams | onClick | Function | | Expand/collapse handler | className | string | | Expander default className |===========================================

=== Properties passing to nodeContentComponent

[cols="2,2,^2,5",options="header"] |=========================================== | Property | Type | Required? | Description 4+| ... Includes all fields of NodeParams | style | Object | | Style object as a result of nodeContentStyle <Tree /> property | className | string | | ClassName string as a result of nodeContentClassName <Tree /> property |===========================================

== License

MIT © link:https://github.com/avin[avin]