New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-pretty-treeview

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pretty-treeview

React Tree View

latest
Source
npmnpm
Version
1.0.34
Version published
Weekly downloads
110
358.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-pretty-treeview

GitHub package version build Download

Preview

Install

npm i --save react-pretty-treeview

Update Table

Updateversiondate
Can customize style in component1.0.1816 May 2018
Can use element class for customize style1.0.2117 May 2018
Fixed bugs style1.0.2318 May 2018
Add custom style1.0.2418 May 2018
Clean file1.0.2519 May 2018
Add .npmignore1.0.2619 May 2018

Props

PropsTypeRequireddefaultDescription
childNameStringnonechilds-
labelNameStringnonename-
labelStyleStringnone--
treeStyleStringnone--
activeNameStringnone--
dataArray or Object if use immutable ( fromJS )yes--
onSelectedFunction , Response (childObject, rootIndex, selectedName, dataList, rootKeyName, rootKey) => console.log(childObject, rootIndex, selectedName, dataList, rootKeyName, rootKey)yes--

Import for using

import TreeView from 'react-pretty-treeview';
 <TreeView
  labelStyle=''
  treeStyle=''
  activeName='revlon-lipstick'
  data={[
    {
      name: 'revlon test',
      description: '',
      status: 'disable',
      open: true,
      itemSize: 5,
      createdDate: 1522846151,
      updatedDate: 1522897770,
      childs: []
    }
  ]}
  onSelected={ action('onSelected')}
/>

Custom style

//style for treeview node
span.tree-view-node:first-child:before{
  content: '';
  width: 1px;
  height: 100%;
  position: absolute;
  left: -15px;
  top: 0px;
  background-color: #ddd;
}
span.tree-view-node:last-child:before{
  content: '';
  width: 1px;
  height: 0%;
  position: absolute;
  left: -15px;
  top: 0px;
  background-color: #ddd;
}
span.tree-view-node span{
  padding-top: 10px;
  margin-left: 30px;
  position: relative;
  list-style: none;
  display: block;
}
//style for treeview label
.tree-view-label{
  cursor: pointer;
  padding: 5px 15px;
  display: inline-block;
  position: relative;
  background-color: #eee;
}
.tree-view-label:hover{
  background: rgba(0,0,0,0.05);
}
.tree-view-label:before{
  content: '';
  width: 1px;
  height: 82%;
  position: absolute;
  left: -15px;
  top: -10px;
  background-color: #ddd;
}

.tree-view-label:after{
  content: '';
  width: 15px;
  height: 1px;
  position: absolute;
  left: -15px;
  top: 50%;
  background-color: #ddd;
}
.tree-view-label.active{
  background-color: #ddd;
  color: #333;
}
.tree-view-label.active:hover{
  background: #eee;
}

Keywords

react

FAQs

Package last updated on 27 May 2018

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