npm

@pxp-ui/tree
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

React Tree Component

Tree component designed for @pxp-ui

Installation

$ npm install @pxp-ui/tree

Basic Usage

import React, { useState } from 'react';
import Tree from '@pxp-ui/tree';

const App = () => {
  const [data, setData] = useState([{
        id: '1',
        label: 'Parent',
        children: [{
          id: '2',
          label: 'Child 1',
        }]
  }]);

  return(
    <TreeMui 
      data={data}
      onSelectedNodes={console.log}
      enableChecked
    />
  )
}

export default App;

Props

Name Type Default Description
enableChecked boolean true Show a checkbox, which allow select the tree item.
data Array [] Initial tree data
options Array Options events for custom menu.
render node The custom content of the tree item.
onLoadChildren function Callback fired when the tree item is selected the first time.
onSelectedNodes function Callback fired when tree items are selected/unselected.

Readme

Keywords

Package Sidebar

Install

npm i @pxp-ui/tree

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

26.1 kB

Total Files

14

Last publish

Collaborators

  • imamani
  • kplian-info