JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 66568
  • Score
    100M100P100Q150812F
  • License MIT

React treebeard Carousel Component

Package Exports

  • react-treebeard

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-treebeard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-treebeard

Fast, Efficient and Customisable Tree View React Component

Install

npm install react-treebeard --save

Example

'use strict';

import React from 'react';
import ReactDOM from 'react-dom';
import Treebeard from 'react-treebeard';

const data = {
    id: 0,
    name: 'root',
    toggled: true,
    children: [
        {
            id: 1,
            name: 'parent',
            children: [
                {
                    id: 2,
                    name: 'child',
                    terminal: true
                }
            ]
        },
        {
            id: 3,
            name: 'loading parent',
            loading: true
        },
        {
            id: 4,
            name: 'parent',
            children: [
                {
                    id: 5,
                    name: 'nested parent',
                    children: [
                        {
                            id: 6,
                            name: 'nested child',
                            terminal: true
                        }
                    ]
                }
            ]
        }
    ]
};

class TreeExample extends React.Component {
    constructor(props){
        super(props);
    }
    onToggle(/* node, toggled */){
        // ...
    }
    render(){
        return (
            <Treebeard
                data={data}
                onToggle={this.onToggle}
            />
        );
    }
}

const content = document.getElementById('content');
ReactDOM.render(<TreeExample/>, content);