
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
detailed-tree-view
Advanced tools
Tree-view is a web component allowing to present json data in a user-friendly way. This component uses LitHTML and LitELement. You can both use the tree-view component as a new class importing it from the file, as well as the HTML tag <tree-view>. The com
Tree-view is a simple API allowing to present json data in a user-friendly way. This component uses LitHTML and LitELement. You can both use the tree-view component as a new class importing it from the file, as well as the HTML tag . The component has two properties: data and headline. You can use them to customize the component and to feed it with your own data.
Install the component...
npm install detailed-tree-view
...and import it afterwards
import "detailed-tree-view";
Depending on whether you need to present a small piece of data or your whole database, you start with either fetching the data from the outside source or writing it in the json format. Below you can see, how I arranged the mock-up data, presented in the demo.
let myData = {Component: { What: { Name: "Tree View" }, Why: { Purpose: "To present fetched data in a user-friendly way" } },Creator: { Name: "Anastazja Galuza", City: "Copenhagen" }}
After importing the component, you can freely use it as an HTML tag. Feed it with data using data as a property or attribute, depending on whether you write simple HTML and JS script or you prefer to use LitHTML library.
Vanila JS:
const treeView = document.getElementById("mytreeview");
treeView.data = myData;
Using LitHTML & LitElement Library:
render(){
html`
<detailed-tree-view id="mytreeview" data="${myData}"></detailed-tree-view>
`}
The module can be easily customized according to your style needs, just like in the example below:

In order to implement your own styling, all you need is to define the css variables mentioned in the code below. The font is inherited, so you can simply assign it to the module f.ex. through a unique id.
:host{
--tree-view-summary-background-color-open: #e0c7db;
--tree-view-summary-background-color-close: #f9d9f3;
--tree-view-summary-border-bottom: 1px solid grey;
--tree-view-value-background-color: #f9d9f3;
}
#mytreeview {
font-family: "Dosis", sans-serif;
color: purple;
}
If you decide not to apply any styling, the module will fallback to the default styling:

Licensed under MIT.
FAQs
Tree-view is a web component allowing to present json data in a user-friendly way. This component uses LitHTML and LitELement. You can both use the tree-view component as a new class importing it from the file, as well as the HTML tag <tree-view>. The com
We found that detailed-tree-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.