A file tree rendering library

@pierre/trees is an open source file tree rendering library. It's built for performance and flexibility, is super customizable, and comes packed with features. Made by The Pierre Computer Company.

Documentation

Currently v1.0.0

Flatten empty directories

Enable the flattenEmptyDirectories boolean option in the tree options. It collapses single-child folder chains into one row. The result is a more compact tree. Tree-shape options…

Show Git status on files

Use the gitStatus option to show status badges for added, modified, deleted, renamed, untracked, and ignored files. Ignored items inherit their styling and show no indicator. Folders with changed descendants get a dot indicator automatically.

Context menu composition

Render your own custom context menu with composition.contextMenu and the React renderContextMenu prop. This demo shows trigger modes for right-click, the trigger button, or both. It also shows menu actions for new files, new folders, rename, and delete. This demo uses Shadcn UI components for the context menu as an example. Your app can use the menus that you already have.