Skip to content
This repository was archived by the owner on Jun 21, 2019. It is now read-only.

Latest commit

 

History

History
40 lines (34 loc) · 1.01 KB

File metadata and controls

40 lines (34 loc) · 1.01 KB

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 sortable-tree-smartweb-theme
import React, { Component } from 'react';
import SortableTree from 'react-sortable-tree';
import CustomTheme from 'sortable-tree-smartweb-theme';

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>
    );
  }
}