Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 913 Bytes

README.md

File metadata and controls

45 lines (33 loc) · 913 Bytes

react-tree-view

A lightweight tree view component for React.

demo

https://react-tree-view.vercel.app

demo source

https://github.com/PaigeWw/react-tree-view/tree/main/example

preview

img

Usage

import TreeView from ''

<TreeView
    dataSource={dataList as DataSource[]}
    height={800}
    width={1200}
    LeafNodeComponent={LeafNodeComponent}
    leafHeight={80}
    leafWidth={360}
    ref={treeViewRef}
/>

API

type TreeViewProps = {
    dataSource: DataSource[];
    width?: number;
    height?: number;
    ref?:  React.MutableRefObject<any>;
    leafHeight: number;
    leafWidth: number;
    LeafNodeComponent: React.FC<any>;
}