react-sortable-tree-theme-checkbox
v0.0.15
Published
Full node drag checkbox theme for react-sortable-tree
Downloads
37
Readme
React Sortable Tree Checkbox Drag Theme
Features
- No drag handles. You can click anywhere on a node to drag it.
Usage
npm install --save react-sortable-tree-theme-checkbox
import React, { useState } from 'react';
import SortableTree from 'react-sortable-tree';
import CustomTheme from 'react-sortable-tree-theme-full-node-drag';
const Tree = () => {
const initTreeData = [{ title: 'Meat', children: [ { title: 'Chickens ', title: 'Pork', title:'Fish' } ] }];
const [treeData, setTreeData] = useState(initTreeData);
return (
<div style={{height: 400}}>
<SortableTree
treeData={treeData}
onChange={treeData => setTreeData(treeData)}
theme={CustomTheme}
/>
</div>
)
}