Trellis
A React Flow of my own: a node-and-edge canvas you can pan, zoom, drag, connect, group, and auto-lay out, with any React component inside a node. One library behind four very different apps.
- Year
- 2026
- Role
- Solo: API design, engineering, and demos
- Built with
- Links
- View on npm
Overview
Trellis is a React library for node-and-edge canvases, published to npm as @sethdavis512/trellis. It does what React Flow does: pan and zoom, drag and box-select, connect handles with bezier, smoothstep, step, or straight edges, nest nodes in group frames that grow to fit their children, and show a minimap and controls. Every node type is a plain React component, so a node can hold a sparkline, a form, or a game card. Two pure layout functions, a tidy tree and a layered layout that minimizes edge crossings, rearrange any graph on demand. The four demos prove the range: an architecture map that lights up one request's path, live server clusters with per-pod load, an editing playground, and a sorting game for kids. Its only runtime dependencies are d3-zoom, d3-drag, and d3-selection.
What I learned
Building a canvas library taught me where the hard parts of React Flow actually are. Coordinates are the core of it: converting between screen and flow space under any zoom, finding a node's handle points, and fitting the view to a set of bounds all live in one tested geometry module. I kept the canvas controlled in the same way React inputs are: it never mutates nodes or edges, it emits typed changes (moved, selected, removed) that the app applies or refuses, which makes persistence and undo the app's choice. An external store read through useSyncExternalStore lets the viewport and an in-flight connection update at drag speed without re-rendering every node. Writing the layered layout meant learning how layer assignment and crossing reduction work, and keeping it a pure function made it easy to test. Touch support pushed me to let a dropped connection join the nearest handle on whatever node it lands on.
The canvas never changes your nodes itself. It reports what happened, and you decide what to keep.
Why it matters
Trellis shows I can design and ship a reusable library with a small, deliberate public API, not just apps that consume one. It already runs in production: company-surface renders its canvas windows as Trellis node types. The work covers interaction design (drag, zoom, selection, keyboard delete), graph layout algorithms, rendering performance, theming through CSS custom properties that follow light and dark mode, and 49 Vitest tests across geometry, layout, changes, and the Flow component. The four demos make the claim visible: one canvas, four products that look and behave nothing alike.
Straight from the product
Screens
06 images, select to enlargeHiring a senior frontend engineer?
I'm looking for my next role on a product team, building design systems and AI tooling. The resume has the details, and my inbox is open.