1.0.11 • Published 6 years ago

react-sortable-tree-theme-bms v1.0.11

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

React Sortable Tree BMS Theme

github: last commit code style: prettier

Preview of theme

Features

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

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

    this.state = {
      treeData: [
        { title: 'Incoming Files' },
        {
          title: 'Encyclopedia',
          children: [
            {
              title: 'Culture',
              children: [{ title: 'Art' }, { title: 'Craft' }],
            },
            { title: 'Science' },
          ]
        },
        {
          title: 'Retail',
          children: [
            { title: 'Node 01' },
            { title: 'Node 02' },
            { title: 'Node 03', children: [{ title: 'Subnode 01' }] },
            { title: 'Node 04' },
            { title: 'Node 05' },
          ],
        },
      ],
    };
  }

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

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago