npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bootstrap-csstree

v1.0.34

Published

[![npm version](https://badge.fury.io/js/bootstrap-csstree.svg)](https://www.npmjs.com/package/bootstrap-csstree) [![Build Status](https://travis-ci.org/hhdevelopment/bootstrap-csstree.svg?branch=master)](https://travis-ci.org/hhdevelopment/bootstrap-csst

Readme

BOOTSTRAP-CSSTREE : A full bootstrap css implementation for tree data structure

npm version Build Status

Demo

Demo

How do I get set up?

Summary of set up

Tree.css is based on bootstrap features.
So add bootstrap.js, bootrap-theme.js, jquery.js.
Optionnaly add fonts from boostrap.
Of course you can use your favorite dependency manager, bower or npm and your favorute packager like webpack.
Treecss is only css so no probleme for packaging.

Finally add bootstrap-csstree.css to your project

Install

Use npm

npm install bootstrap-csstree --save  

Include css in your build

node_modules/bootstrap-csstree/dist/bootstrap-csstree.css

sample.PNG

Configuration

In your index.html

  • Add bootstrap-csstree.css directly or from you dependencies tools (npm, webpack, gulp, etc...)
<!DOCTYPE html>
<html ng-app="tree-demo">
	<head>
		...
		<link rel="stylesheet" href="bootstrap-csstree.css">
		...
  • Add root tree
<div class="tree">
	<span ng-repeat="folder in ctrl.folders track by $index" ng-include="'tree-template.html'"></span>
</div>

See class tree
Here we use recursive template tree-template.html

See classes for style tree :

  • class disabled

  • Define items template **** tree-template.html

<span>
	<div ng-class="{'active':ctrl.selectedFolderIds.includes(folder.id) || folder.active, 
							'tree-item-info':folder.info, 
							'tree-item-success':folder.success, 
							'tree-item-warning':folder.warning, 
							'tree-item-danger':folder.danger, 
							'disabled':folder.disabled}" 
			class="tree-item"> 
		<span ng-click="ctrl.handlerSelectFolder($event, folder)">
			<a href data-toggle="collapse" data-target="#folder{{folder.id}}">
				<i open notselect ng-class="{'invisible':!folder.folders || !folder.folders.length}" class="glyphicon glyphicon-minus"></i>
				<i open notselect class="glyphicon glyphicon-folder-open"></i>
				<i close notselect class="glyphicon glyphicon-plus"></i>
				<i close notselect class="glyphicon glyphicon-folder-close"></i>
			</a>
			<span class="badge" ng-bind="0"></span>
			{{folder.label}} {{folder.id}}
 		</span>
	</div>
	<div ng-if="folder.folders && folder.folders.length" class="tree-children collapse in" id="folder{{folder.id}}">
		<span ng-repeat="folder in folder.folders track by $index" ng-include="'tree-template.html'"></span>
	</div>
</span>

See main class

  • class tree-item

See classes for style tree-item :

  • class tree-item-success
  • class tree-item-info
  • class tree-item-warning
  • class tree-item-danger
  • class active
  • class disabled

See for collapse, folde, expande icons :

  • atttribute open
  • atttribute close

Add noselect on node that not select item
Add data-toggle and data-target for use boostrap feature collapse in and out

See classes :

  • tree-childen
  • collapse
  • in : treechildren will be open

In js add click handler

Example in angular 1

var ctrl = this;
ctrl.folders = [];
ctrl.handlerSelectFolder = handlerSelectFolder;
ctrl.selectedFolderIds = [];

/**
 * folder selection 
 * @param {type} event
 * @param {type} folder
 */
function handlerSelectFolder(event, folder) {
	if(!event.target.hasAttribute("notselect") && !folder.disabled) {
		if(!event.ctrlKey) {
			ctrl.selectedFolderIds = [folder.id];
		} else {
			var idx = ctrl.selectedFolderIds.indexOf(folder.id);
			if(idx !== -1) {
				ctrl.selectedFolderIds.splice(idx, 1);
			} else {
				ctrl.selectedFolderIds.push(folder.id);
			}
		}
	}
}

Function handlerSelectFolder can be use for standard use. ctrl key press for multi select, etc...