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

buttons-tree

v0.0.33

Published

Angular component library for rendering a hierarchical buttons grid (ideal for POS/category navigation) with:

Readme

buttons-tree

Angular component library for rendering a hierarchical buttons grid (ideal for POS/category navigation) with:

  • Recursive tree navigation
  • Optional button images
  • Press/hold interaction
  • Swipe-right navigation to previous panel
  • Swipe-left navigation forward to the previously visited panel
  • Configurable row spacing

Preview

Hierarchy and panel behavior:

ButtonsTree Hierarchy

Swipe-right back navigation:

ButtonsTree Swipe Back

Installation

npm install buttons-tree

Module Setup

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ButtonsTreeModule } from 'buttons-tree';

@NgModule({
	imports: [BrowserModule, ButtonsTreeModule],
})
export class AppModule {}

Basic Usage

<buttons-tree
	[buttonsTree]="buttonsTree"
	[isDisplayImage]="true"
	[storageRootPath]="storageRootPath"
	[buttonBackTitle]="'חזרה'"
></buttons-tree>

POS-style conditional render example:

<buttons-tree
	*ngIf="(search_text.value?.length ?? 0) === 0 && (_items?.length ?? 0) === 0"
	[buttonsTree]="buttonsTree"
	[isDisplayImage]="true"
	[storageRootPath]="storage_root_path"
	[buttonBackTitle]="'חזרה'"
></buttons-tree>

Inputs

| Input | Type | Default | Description | |---|---|---|---| | buttonsTree | Node[] \| undefined | undefined | Root nodes to render. | | isDisplayImage | boolean | false | Show image inside each button. | | maxColumns | number | 4 | Number of buttons per row. Minimum is 1. | | autoMaxColumns | boolean | true | Auto-fit columns by container width (never exceeds maxColumns). | | minButtonWidth | number | 120 | Minimum button width in px used for auto-fit column calculation. | | storageRootPath | string | "" | Base path to prepend to image paths from data. | | buttonBackTitle | string | "" | Back button label for child panels. | | rowGap | string | "10px" | Vertical spacing between rows (e.g. "6px", "0.75rem"). | | enableBackSwipe | boolean | true | Enables swipe-right back navigation. | | enableForwardSwipe | boolean | true | Enables swipe-left forward navigation to the previously visited panel. |

Row Spacing Customization

Set spacing directly from your app:

<buttons-tree
	[buttonsTree]="buttonsTree"
	[rowGap]="'14px'"
></buttons-tree>

Or use CSS variable override in host context:

buttons-tree {
	--buttons-tree-row-gap: 14px;
}

The button grid is responsive by default and adapts to available panel width on different screen resolutions.

Example: cap at 4 columns but auto-drop to 3/2/1 on narrower panels.

<buttons-tree
	[buttonsTree]="buttonsTree"
	[maxColumns]="4"
	[autoMaxColumns]="true"
	[minButtonWidth]="120"
></buttons-tree>

Swipe Behavior Configuration

Disable forward-swipe (keep only back-swipe and back button):

<buttons-tree
	[buttonsTree]="buttonsTree"
	[enableForwardSwipe]="false"
></buttons-tree>

Disable back-swipe while keeping forward-swipe enabled:

<buttons-tree
	[buttonsTree]="buttonsTree"
	[enableBackSwipe]="false"
	[enableForwardSwipe]="true"
></buttons-tree>

Data Shape

Minimal structure expected by the component:

interface Node {
	guid?: string;
	data: {
		name: string;
		imagePath?: string;
		// Other fields allowed
	};
	nodes?: Node[];
}

Publish (Maintainers)

ng build ButtonsTree
cd dist/buttons-tree
npm publish

Notes

  • Long labels are clamped to 2 lines with ellipsis for symmetry.
  • Child/parent panel transitions are handled by component logic.
  • If your app needs stronger branding, override styles in your app shell while keeping library defaults as baseline.