UI Lab

    Tree & Flow Variants

    30 dynamic, zero-dependency tree canvases — add, edit, remove nodes and copy the source

    No external graph library

    Fulfilment Pipeline

    Branching workflow with stage labels — like the warehouse fulfilment screenshot.

    Hover any node to add a child, rename or remove it. Drag the grip handle on draggable variants to reparent or reorder. Read-only variants disable every affordance.

    13/13

    Search matches node labels. Sort re-orders each parent's children. Tags / smart filter mark which nodes match; Dim fades non-matches in place, Hide removes them from the tree.

    100%
    ORDER POOL

    Order Pool

    FULFILLMENT

    Fulfillment

    PICK

    Pick

    TASK RELEASE

    Task Release

    PICK

    Full Pallet Pull

    AI Recommended

    PACK

    Case → LPN Build

    CONSOLIDATION

    Order Consolidation

    AUDIT

    Order Audit

    VAS

    Pallet Wrap

    LABEL

    Print Labels

    STAGE

    Stage by Carrier

    SHIP

    Load LTL Shipment

    PACK

    Sort & Pack

    Source Code

    Required Dependencies & Files

    Install packages and copy 11 files to get this tree running.

    Runtime deps

    npm install react react-dom lucide-react clsx tailwind-merge
    • Requires shadcn/ui components: badge.
    • Bring `cn` from your `@/lib/utils` (clsx + tailwind-merge).
    • Zero graph-library dependency — TreeCanvas computes layouts + drag itself.
    • The GraphToolbar (search / sort / filter) installs only for variants with `showToolbar: true`.
    Variant-specific (regenerated per tree) Shared engine (copy once)
    Variant-specific

    The composed component — drop into any page. Includes the GraphToolbar search/sort/filter bar.

    src/components/tree-instances/FulfilmentPipeline.tsx
    src/components/tree-instances/FulfilmentPipeline.tsx
    import { useState } from "react";
    import { TreeCanvas } from "@/components/tree/TreeCanvas";
    import type { TreeNode } from "@/components/tree/types";
    import { GraphToolbar, useGraphFilter, defaultGraphFilter } from "@/components/graph";
    import { initialTree } from "./data";
    import { treeConfig } from "./config";
    import { useFulfilmentPipelineHandlers } from "./handlers";
    
    /**
     * FulfilmentPipeline — a fully-typed, self-contained tree with a search / sort /
     * filter toolbar above the canvas.
     *
     * Drop into any page:
     *   <FulfilmentPipeline />
     *
     * To plug into a backend, edit the handlers in `./handlers.ts`. To remove the
     * toolbar, delete the `GraphToolbar`/`useGraphFilter` wiring below and set
     * `showToolbar: false` in `./config.ts`.
     */
    export function FulfilmentPipeline() {
      const [tree, setTree] = useState<TreeNode>(initialTree);
      const [filter, setFilter] = useState(defaultGraphFilter);
      const { handleNodeAdd, handleNodeUpdate, handleNodeRemove, handleNodeMove } = useFulfilmentPipelineHandlers();
      const { tree: filteredTree, matches, stats, allTags } = useGraphFilter(tree, filter);
    
      return (
        <div className="flex flex-col gap-2">
          <GraphToolbar
            filter={filter}
            onChange={setFilter}
            allTags={allTags}
            matched={stats.matched}
            total={stats.total}
          />
          <TreeCanvas
            config={treeConfig}
            tree={filter.mode === "hide" ? filteredTree : tree}
            onTreeChange={setTree}
            highlightIds={filter.mode === "dim" ? matches : undefined}
            onNodeAdd={handleNodeAdd}
            onNodeUpdate={handleNodeUpdate}
            onNodeRemove={handleNodeRemove}
            onNodeMove={handleNodeMove}
          />
        </div>
      );
    }