Zero runtime dependencies · ESM + CJS · MIT

@grida/tree-view

Headless, agnostic tree-view controller for editors and IDEs — a pure state machine plus a small set of helpers, rendered with whatever framework you want. The showcases below are the same TreeController wired to different surfaces — canvas, explorer, document, desktop.

Grida
Grida

One TreeController drives the panel and the artboard. Select, hover, reorder, delete on either side — the other follows.

Cover
Action
View report →
Button BG
Items
Releases
Reviews
Commits
Divider
Delta
Hero
Eyebrow
Nothing selected
CoverACTIVITY1,284+18% vs last weekCommits24Reviews8Releases2View report →

Drag rows to reorder · click a shape to select · ⌫ to delete

Figma
Figma

Identical controller and intent bridge — only the row renderer and the canvas palette changed. Reordering a layer re-stacks the design.

LayersCover
Cover
Action
View report →
Button BG
Items
Releases
Reviews
Commits
Divider
Delta
Hero
Eyebrow
Nothing selected
CoverACTIVITY1,284+18% vs last weekCommits24Reviews8Releases2View report →

Drag rows to reorder · click a shape to select · ⌫ to delete

VS Code
VS Code

Filesystem semantics: drops resolve into the nearest folder. Selecting a file opens it — selection is the only wire to the editor pane.

Explorer
src
components
Button.tsx
Card.tsx
app
page.tsx
layout.tsx
globals.css
lib
utils.ts
api.ts
index.ts
public
favicon.ico
vercel.svg
package.json
tsconfig.json
README.md
@grida/tree-view
Select a file in the explorer to open it
Show All Commands⇧⌘P
Go to File⌘P
Find in Files⇧⌘F
Toggle Terminal⌃`
Open Settings⌘,
Notion
Notion

Workspace sidebar with nested pages, emoji affordances, and drag-into-page. Selecting a page swaps the document on the right — one controller, one selection channel.

softmarshmallow's Notion
👋Getting Started
🏡Personal
Tasks
📝Notes
📚Reading list
👥Team
🛠Engineering
🗓Sprint planning
🚨On-call runbook
🎨Design
📋Product
🗂Templates
Workspace/Notes
Share•••
📝

Notes

Pages live in the sidebar — selecting one opens it here. Drop a page onto another to nest; drag between two pages to reorder. The sidebar and this document are wired to the same TreeController.

💡The tree-view package never reads your page content. The doc you’re reading is a static mock — only the selection wires through.

Today

  • ☐ Triage CodeRabbit comments on PR 719
  • ☐ Wire F12 reversed+desiredDepth test
  • ☑ Reverse-aware drag math (F10)
  • ☑ Tolerant expandTo (F11.1)
Finder
Finder

Multi-column rows, zebra striping, double-click to expand — the same core, dressed as macOS and dropped onto the desktop.

Finder
Mon 9:41 AM
softmarshmallow
Name
Documents
grida
README.md
Notes.md
Resume.pdf
Screenshot.png
Downloads
Installer.dmg
Trailer.mp4
Applications
Figma.app
Visual Studio Code.app
Grida.app
FinderSafariMessagesMapsNotesRemindersFreeformMusicLogic ProXcodeVS CodeGridaTrash

A tree in 20 lines.

One source, one controller, one provider. Render the rows with whatever markup you want — the package owns expansion and selection, your store owns the data.

Built for editor scale.

The state machine, the math, the intents — packaged so adopters ship a tree in a day, not a quarter.

Canvas layers

Canvas layers

Reverse-children flatten, group highlight, selection-aware drag — the controller already knows what a design tool's layers panel needs.

Dark layers panel

Dark layers panel

Same controller, themed for any palette. Compose constraints to enforce frame / component / instance semantics.

File explorer

File explorer

Filesystem drag rule — drops resolve into the nearest folder. Drop-target highlight cascades through descendants.

Workspace sidebar

Workspace sidebar

Emoji-prefixed pages, nested toggles, drop-into-page. Selection wires the document body in three lines.

Native window

Native window

Multi-column rows, zebra striping, double-click-to-expand — all consumer-side; the package never touches the markup.

See every pattern.

The documentation page walks through 18 panels — themed showcases, virtualization at 10,000 rows, inline rename, type-ahead, grouping highlights, and more.