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

solid-trees

v1.2.0

Published

SolidJS 2 port of @pierre/trees: a virtualized, path-first file tree.

Readme

solid-trees

solid-trees

Virtualized, path-first file tree for SolidJS 2

SolidJS 2 port of @pierre/trees. The model layer (path store, controller, focus, selection, search, rename, drag and drop, git status) is vendored from upstream; the view is a native Solid 2 rewrite of upstream's Preact FileTreeView, rendered into the light DOM, with upstream's visual styles shipped as an importable stylesheet.

Features

  • Virtualized rendering, built for large trees
  • Path-first model: feed it a list of paths, get a tree
  • Focus, multi-selection, and keyboard navigation
  • Built-in search, inline rename, and drag and drop
  • Git status decorations
  • Sticky folders and flattened empty directories
  • Custom icons, labels, header, and context menu (Solid JSX)
  • Upstream's visual styles, tokens, and layers, themable with Shiki/VS Code themes
  • Light DOM only: style it with plain page CSS

Users

Examples

Run them locally from the repository root:

pnpm dev        # playground
pnpm dev:docs   # docs

Installation

pnpm add solid-trees solid-js @solidjs/web

Requires Solid 2 (solid-js and @solidjs/web ^2.0.3).

Usage

import { createFileTree, createFileTreeSelection, FileTree } from 'solid-trees';

function Explorer() {
  const tree = createFileTree({
    paths: ['README.md', 'src/index.ts', 'src/components/Button.tsx'],
    initialExpansion: 'open',
    flattenEmptyDirectories: true,
    stickyFolders: true,
    search: true,
    renaming: true,
    dragAndDrop: true,
  });
  const selected = createFileTreeSelection(tree);

  return (
    <FileTree
      model={tree}
      style={{ height: '320px' }}
      header={<strong>Files</strong>}
      renderContextMenu={(item, menu) => (
        <div role="menu">
          <button
            onClick={() => {
              menu.close({ restoreFocus: false });
              tree.startRenaming(item.path);
            }}
          >
            Rename
          </button>
        </div>
      )}
    />
  );
}
  • createFileTree(options) creates a FileTreeModel owned by the current reactive owner (cleaned up on dispose). Options are read once; change state through model methods (add, move, remove, batch, resetPaths, setGitStatus, applyGitStatusPatch, setIcons, setLabels, setComposition, openSearch, startRenaming, scrollToPath, ...).
  • Model getters (getSelectedPaths, getFocusedPath, isSearchOpen, ...) track inside Solid scopes and always return current values imperatively.
  • createFileTreeSelector(model, select, isEqual?), createFileTreeSelection(model), createFileTreeSearch(model) derive memos from the model.
  • <FileTree> needs a bounded height. Swapping the model prop remounts the view.

Styling

import 'solid-trees/styles.css';

The stylesheet is a port of upstream's style.css: the same --trees-* tokens, the same fallback chain (--trees-*-override → --trees-theme-* → default), colored file icons, git status colors, selection/focus/hover states, indent guides (the focused row's parent guide carries data-item-guide-focused="true"), sticky rows, search input, rename input, drag states, the context-menu trigger, and middle truncation of long names.

  • Scoping: every rule sits in @scope ([data-file-tree-virtualized-root]). Header and context-menu content is excluded from the scope (it still inherits color and font from the root).
  • Layers: @layer solid-trees.structure, solid-trees.base, solid-trees.theme. <FileTree> injects solid-trees.structure itself (virtualizer layout, row lanes, truncation mechanics), so trees work without the import; the import adds solid-trees.base. solid-trees.theme is reserved for your theme rules. Unlayered page CSS overrides every layer (it replaces upstream's unsafeCSS).
  • Page resets: the base layer starts with a reset for the tree's own controls, so element rules from layers declared earlier (e.g. Tailwind's preflight in @layer base) do not leak into rows. Rules in later layers or unlayered rules still win; import solid-trees/styles.css after your reset or declare the order up front (@layer theme, base, components, utilities, solid-trees;).
  • Color scheme: the root sets color-scheme: light dark, so colors follow the OS preference. Pin it with style={{ 'color-scheme': 'dark' }} or CSS.
  • Tokens: set any --trees-*-override on the tree (style) or an ancestor. Density (--trees-item-height, --trees-density-override) is set inline from the density / itemHeight options.

Shiki/VS Code themes map onto the --trees-theme-* tokens with themeToTreeStyles (uses @pierre/theming); the result is a Solid style object:

import dracula from '@shikijs/themes/dracula';
import { themeToTreeStyles } from 'solid-trees';

<FileTree
  model={tree}
  style={{ height: '320px', ...themeToTreeStyles(dracula) }}
/>;

Differences from @pierre/trees

  • No shadow DOM, custom element, SSR/hydration, or unsafeCSS; use page CSS.
  • Header and context-menu content are Solid JSX (header, renderContextMenu props); composition.contextMenu keeps the behavior flags (enabled, triggerMode, buttonVisibility) and onOpen/onClose.
  • The DOM keeps upstream's data attributes (data-type="item", data-item-path, data-item-selected, data-item-focused, data-item-git-status, data-item-section, data-file-tree-sticky-row, ...) and name markup (MiddleTruncate / Truncate), so upstream CSS ports over.
  • Each tree prefixes the symbol ids of its sprite sheet (built-in set plus icons.spriteSheet) so several trees in one document never resolve each other's icons; names a sheet does not define resolve document-wide.
  • The scrollbar gutter (--trees-scrollbar-gutter-measured) is measured once per document, not per tree.
  • themeToTreeStyles returns CSS property names (background-color), not React's camelCase.

Security

To report a security vulnerability, please do not open a public GitHub issue. Email [email protected] instead. For the supported versions, scope, and supply chain hardening, see SECURITY.md.

Compiling From Source

You will need Node.js and pnpm.

| Path | Contents | | ---------------------- | ----------------------------------------------------------- | | packages/path-store | Upstream @pierre/path-store, vendored verbatim (private). | | packages/solid-trees | The library: model, Solid view, primitives. | | apps/playground | Astro demo site (pnpm dev). | | apps/docs | Fumadocs + Astro docs site (pnpm dev:docs). |

pnpm install
pnpm dev        # playground on http://localhost:4321
pnpm dev:docs   # docs on http://localhost:4322/docs
pnpm test       # vitest + jsdom
pnpm typecheck
pnpm build      # library to packages/solid-trees/dist, apps to apps/*/dist

Pushes to main publish solid-trees to npm via semantic-release (version from Conventional Commits, tags vX.Y.Z) and deploy the playground to trees.inve.rs and the docs to trees.inve.rs/docs. The published package is the built dist/ with @solid-trees/path-store bundled in, assembled by pnpm release:pack into release-package/; publish manually from there with npm publish, not from the workspace root or packages/solid-trees.

Contributing

Issues and pull requests are welcome. Run pnpm lint, pnpm format:check, pnpm typecheck, and pnpm test before opening a PR, and use Conventional Commits since versions are derived from them.

Support This Project

If you find solid-trees useful and would like to support its development, you can consider making a donation on wise. Your contribution helps ensure continued maintenance and improvements.

Donate on Wise

Thank you for your support!

License

solid-trees is released under the Apache License 2.0. Derived from @pierre/trees and @pierre/path-store by The Pierre Computer Company; see NOTICE.md and packages/*/LICENSE.md.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in solid-trees by you, shall be licensed as Apache-2.0, without any additional terms or conditions.