nikolas-sapa

Tree Box Drawing

Navigation 18

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
  • Dye Whorl

    Dye Whorl

    142
  • Countdown Vapor Digits

    Countdown Vapor Digits

    139
  • Hero Burin Hatch

    Hero Burin Hatch

    63
  • Background ASCII Wake

    Background ASCII Wake

    61
  • Hero Text Ring Funnel

    Hero Text Ring Funnel

    50
  • Hero ASCII Schlieren

    Hero ASCII Schlieren

    49
  • Toast Gravity Stack

    Toast Gravity Stack

    48
  • Hero ASCII Reaction Front

    Hero ASCII Reaction Front

    45

More in Navigation

View all
  • Sidebar

    Sidebar

    286
  • Navbar

    Navbar

    1
  • Tabs

    Tabs

    34
  • Oversized 404 Numeral

    Oversized 404 Numeral

    57
  • Breadrcrumb

    Breadrcrumb

    8
  • Pagination

    Pagination

    91
  • Sidebar

    Sidebar

    348
  • Pagination

    Pagination

    15