Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eyzy-tree

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eyzy-tree

React tree component

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
96
decreased by-40.74%
Maintainers
1
Weekly downloads
 
Created
Source

One more React Tree component

Most expected tree ui component for React.

NPM version NPM license NPM total downloads NPM monthly downloads

Documentation | Examples

assets_-LIk7qYrBMivIw5dM3CP_-LXrbHDPWExqQURbPB5D_-LXrfVI_P7Wt8GJVXrVe_red

Features

  • flexible configuration
  • rich options
  • rich API
  • events for every action
  • keyboard navigation
  • check boxes
  • multi-selection
  • async support

Table of Contents

Getting Started

Installing a package using the package manager.

# NPM
npm install eyzy-tree

# YARN
yarn add eyzy-tree

Connect in browser.

<script src="https://cdn.jsdelivr.net/npm/eyzy-tree/dist/eyzy-tree.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/eyzy-tree/dist/style.css" rel="stylesheet" />

Usage

import React, { Component } from 'react'
import EyzyTree from 'eyzy-tree'
import 'eyzy-tree/style.css'

export default class Tree extends Component {
  constructor(props) {
    super(props);

    this.state = {
      data: [
        { text: 'Item 1' },
        { text: 'Item 2' },
        { text: 'Item 3' },
      ],
    };
  }

  render() {
    return (
      <div style={{ height: 400 }}>
        <EyzyTree
          data={this.state.data}
        />
      </div>
    );
  }
}

Customization

Click here to find out how to configure the component.

Tree Props

PropertyTypeDescriptionDefault
data (required)arraySpecifies the tree nodes
fetchDatafunctionFetch child node if it has isBatch property
textRendererReactNodeOverrides text container. Gets the Node by argument
arrowRendererReactNodeOverrides arrow container. Gets the Node by argument
checkboxRendererReactNodeOverrides checkbox container. Gets the Node by argument
checkablebooleanAdds a checkbox before the tree nodesfalse
noCascadebooleanWhether to apply checkbox state to child nodes recursivelytrue
useIndeterminateStatebooleanWhether to show indeterminate state for nodetrue
preventSelectParentbooleanWhether to allow to select node which has child (it will expand if true)false
keyboardNavigationbooleanWhether to allow navigate via keyboardtrue
selectOnExpandbooleanWhether to select a node if it has childrenfalse
expandOnSelectbooleanWhether to expand a node if it has childrenfalse
checkOnSelectbooleanSelects a node and changes the state of the checkbox.false
selectOnCheckbooleanWhether to select a node if it checked (during the click)false
themestringAdditional class for tree container.eyzy-theme

Tree Events

PropertyArgumentsDescription
onReadyAPICall once when tree is ready (componentDidMount).
onSelectTreeNodeCalls every time when node is selected.
onUnSelectTreeNodeCalls every time when node is unselected.
onCheckTreeNodeCalls every time when node is checked.
onExpandTreeNodeCalls every time when node is expanded.
onRemoveTreeNodeCalls every time when node is removed.
onAddTreeNodeCalls every time when node is added.
onDoubleClickTreeNodeCalls every time when user do double click on the node. Works only when expandOnSelect is not defined or false

Node Props

PropertyTypeDescription
idstringNode id. If not transmitted, automatically generated.
text (required)stringNode text
childArrayList of child nodes
dataobjectAny type of data
isBatchbooleanCheck the API
classNamestringNode class name
checkablebooleanWhether to possible to check a node (checkbox will be hidden)
loadingbooleanWill be added loading class (indicator is added via CSS)
selectedbooleanWhether to select a node
expandedbooleanWhether to expand a node
checkedbooleanWhether to check a node (if tree is checkable)
disabledbooleanWhether to disable a node
disabledCheckboxbooleanWhether to disable a node's checkbox

Licence

MIT

Keywords

FAQs

Package last updated on 21 May 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc