1.1.1 • Published 5 years ago

react-sortable-tree-smartweb v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Sortable Tree Smartweb Theme

theme appearance

Features

  • Contains some external changes, added subtitles and other stuff
  • You can click anywhere on a node to drag it.
  • More compact design, with indentation alone used to represent tree depth.

Usage

npm install --save react-sortable-tree-smartweb
import React, { Component } from 'react';
import SortableTree from 'react-sortable-tree';
import CustomTheme from 'react-sortable-tree-smartweb';

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

    this.state = {
      treeData: [{ title: 'src/', children: [ { title: 'index.js' } ] }],
    };
  }

  render() {
    return (
      <div style={{ height: 400 }}>
        <SortableTree
          treeData={this.state.treeData}
          onChange={treeData => this.setState({ treeData })}
          theme={CustomTheme}
        />
      </div>
    );
  }
}