0.0.2 • Published 4 years ago

react-sortable-tree-simple-ui-1 v0.0.2

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

Minimal React Sortable Tree Theme

Features

  • Minimalistic Theme for React Sortable Tree

Usage

npm install --save react-sortable-tree-simple-ui-1
import React, { Component } from 'react';
import SortableTree from 'react-sortable-tree';
import FileExplorerTheme from 'react-sortable-tree-simple-ui-1';

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={FileExplorerTheme}
        />
      </div>
    );
  }
}