New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-tj-treeview

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tj-treeview

TJ Treeview for React

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

npm npm

react-tj-treeview

Example

npm install
cd examples && npm install
npm start

Then open http://localhost:3000 in a browser.

Install

npm install react-tj-treeview

Screenshot

Screenshot

Customize

SCSS

You will need CSS for using this module, customize from SCSS.

$hoverBorderColor: #e0e0e0;

.tree {
  &-root {
    margin: 7px 0;
  }

  ul,
  li {
    list-style: none;
  }

  li {
    margin:      1px 0;
    user-select: none;
  }

  li > label {
    display:       inline-block;
    cursor:        pointer;
    padding:       3px 7px;
    border-radius: 6px;
    border-bottom: 1px solid transparent;

    &:hover {
      border-bottom: 1px solid $hoverBorderColor;
    }

    &:before {
      content: "";
      display: inline-block;
    }

    &.has-children {
      font-size:   110%;
      font-weight: bold;

      &:before {
        font-family:  FontAwesome;
        content:      "\f067";
        font-size:    10px;
        font-weight:  lighter;
        margin-right: 5px;
      }
    }
  }

  input:checked + label.has-children {
    &:before {
      font-family: FontAwesome;
      content:     "\f068";
    }
  }

  input {
    display: none;
  }

  & input + label + ul {
    margin-left: 10px;
  }

  input ~ ul {
    display: none;
  }

  input:checked ~ ul {
    display: block;
  }
}

Data (JSON)

[{
  "label": "Sci-Fi",
  "collapse": false,
  "children": [{
    "label": "Interstella",
    "collapse": false,
    "children": [{
      "label": "Matthew McConaughey",
      "leaf": true
    }]
  }]
}, {
  "label": "Action",
  "collapse": false,
  "children": [{
    "label": "Edge of Tomorrow",
    "collapse": false,
    "children": [{
      "label": "Emily Blunt",
      "leaf": true
    }]
  }]
}, {
  "label": "Fantasy",
  "collapse": false,
  "children": [{
    "label": "Fantastic Beasts and Where to Find Them",
    "collapse": false,
    "children": [{
      "label": "Eddie Redmayne",
      "leaf": true
    }]
  }, {
    "label": "Miss Peregrine\"s Home for Peculiar Children",
    "collapse": false,
    "children": [{
      "label": "Eva Green",
      "leaf": true
    }, {
      "label": "Samuel L. Jackson",
      "leaf": true
    }]
  }, {
    "label": "Star Wars",
    "collapse": false,
    "children": [{
      "label": "Mark Hamill",
      "leaf": true
    }, {
      "label": "Harrison Ford",
      "leaf": true
    }, {
      "label": "Felicity Jones",
      "leaf": true
    }, {
      "label": "Daisy Ridley",
      "leaf": true
    }, {
      "label": "Mads Mikkelsen",
      "leaf": true
    }, {
      "label": "Emilia Clarke",
      "leaf": true
    }]
  }, {
    "label": "Doctor Strange",
    "collapse": false,
    "children": [{
      "label": "Benedict Cumberbatch",
      "leaf": true
    }, {
      "label": "Rachel McAdams",
      "leaf": true
    }, {
      "label": "Chiwetel Ejiofor",
      "leaf": true
    }, {
      "label": "Mads Mikkelsen",
      "leaf": true
    }]
  }]
}, {
  "label": "Comedy",
  "collapse": false,
  "children": [{
    "label": "The Wolf of Wall Street",
    "collapse": false,
    "children": [{
      "label": "Leonardo DiCaprio",
      "leaf": true
    }, {
      "label": "Matthew McConaughey",
      "leaf": true
    }]
  }, {
    "label": "Bad Moms",
    "collapse": false,
    "children": [{
      "label": "Mila Kunis",
      "leaf": true
    }]
  }, {
    "label": "Ghostbusters",
    "collapse": false,
    "children": [{
      "label": "Kristen Wiig",
      "leaf": true
    }]
  }, {
    "label": "Deadpool",
    "collapse": false,
    "children": [{
      "label": "Ryan Reynolds",
      "leaf": true
    }]
  }]
}]

License

MIT, see the LICENSE file for detail.

Keywords

FAQs

Package last updated on 27 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc