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

@byte5digital/payload-tree-view

v1.0.6

Published

A Payload CMS plugin that replaces the default list view with a hierarchical tree view for collections with self-referencing parent fields

Readme

Payload Tree View

A Payload CMS plugin that replaces the default list view with a hierarchical tree view for collections that have self-referencing parent fields.

Built for Payload v3.37+.

Installation

npm install @byte5digital/payload-tree-view
# or
yarn add @byte5digital/payload-tree-view

Important: After installing, you must regenerate Payload's import map for the plugin's custom components to be picked up:

yarn generate:importmap

Usage

Add the plugin to your Payload config and specify which collections should use the tree view:

import { buildConfig } from 'payload'
import { payloadTreeView } from '@byte5digital/payload-tree-view'

export default buildConfig({
  // ...
  plugins: [
    payloadTreeView({
      collections: {
        pages: true, // uses 'parent' field by default
        categories: {
          parentField: 'parentCategory', // custom parent field name
          allowToggle: false, // disable switching back to list view
        },
      },
    }),
  ],
})

Your collection must have a self-referencing relationship field (e.g. a parent field that relates to the same collection). The plugin reads this field to build the hierarchy.

Configuration

Plugin Options

| Option | Type | Description | | ------------- | -------- | ------------------------------------------------ | | collections | object | Map of collection slugs to tree view config | | disabled | boolean| Disable the plugin without removing it |

Per-Collection Options

Pass true to use defaults, or an object:

| Option | Type | Default | Description | | ------------- | -------- | ---------- | ------------------------------------------------ | | parentField | string | 'parent' | Name of the self-referencing relationship field | | allowToggle | boolean| true | Allow users to switch between tree and list views |

Features

  • Hierarchical tree view with expand/collapse controls
  • Expand all / collapse all buttons
  • Toggle between tree view and default list view (can be disabled per collection)
  • Preserves Payload's list chrome: filters, search, sorting, bulk actions, and column selection
  • View mode preference persisted in localStorage
  • Supports relationship fields rendered as thumbnails (upload collections)
  • Orphaned documents (with missing/deleted parents) appear as root nodes

Tree View

Tree View

Development

pnpm build        # Build the plugin
pnpm lint         # Run ESLint
pnpm lint:fix     # Fix lint issues
pnpm test:int     # Run unit tests (vitest)
pnpm test:e2e     # Run E2E tests (Playwright)

License

MIT