nikolas-sapa

Tree Box Drawing

Navigation 19

About

A file/directory tree rendered with real monospace box-drawing connectors (├── └── │) that redraw themselves as folders expand and collapse, with full keyboard navigation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tree Box Drawing to your project and fits it to your theme.

Code

How Tree Box Drawing is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { BoughIndex, type BoughNode } from "@/components/ui/tree-box-drawing";

const nodes: BoughNode[] = [
  {
    id: "src",
    label: "src",
    children: [
      {
        id: "components",
        label: "components",
        children: [
          { id: "button", label: "button.tsx" },
          { id: "card", label: "card.tsx" },
          { id: "input", label: "input.tsx" },
        ],
      },
      {
        id: "lib",
        label: "lib",
        children: [{ id: "utils", label: "utils.ts" }],
      },
      { id: "app", label: "app.tsx" },
      { id: "index", label: "index.ts" },
    ],
  },
  { id: "package", label: "package.json" },
  { id: "readme", label: "readme.md" },
];

export default function TreeBoxDrawingDemo() {
  return (
    <div className="flex w-full items-center justify-center p-10">
      <BoughIndex
        label="Project files"
        nodes={nodes}
        defaultExpandedIds={["src", "components"]}
      />
    </div>
  );
}

More by nikolas-sapa

View all
  • Countdown Vapor Digits

    Countdown Vapor Digits

    160
  • Dye Whorl

    Dye Whorl

    152
  • Background ASCII Wake

    Background ASCII Wake

    70
  • Hero Burin Hatch

    Hero Burin Hatch

    68
  • Hero Text Ring Funnel

    Hero Text Ring Funnel

    56
  • Hero ASCII Schlieren

    Hero ASCII Schlieren

    56
  • Toast Gravity Stack

    Toast Gravity Stack

    54
  • Hero ASCII Reaction Front

    Hero ASCII Reaction Front

    54

More in Navigation

View all
  • Sidebar

    Sidebar

    329
  • Oversized 404 Numeral

    Oversized 404 Numeral

    65
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    52
  • Stacked Circular Footer

    Stacked Circular Footer

    439
  • Footer 2

    Footer 2

    217
  • Pagination with Icon and Label

    Pagination with Icon and Label

    20
  • Tabs

    Tabs

    33
  • Navbar

    Navbar

    4