nikolas-sapa

Tree Box Drawing

Navigation 16

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

    138
  • Countdown Vapor Digits

    Countdown Vapor Digits

    122
  • Hero Burin Hatch

    Hero Burin Hatch

    62
  • Background ASCII Wake

    Background ASCII Wake

    54
  • Hero Text Ring Funnel

    Hero Text Ring Funnel

    48
  • Toast Gravity Stack

    Toast Gravity Stack

    46
  • Hero ASCII Schlieren

    Hero ASCII Schlieren

    45
  • Hero ASCII Reaction Front

    Hero ASCII Reaction Front

    41

More in Navigation

View all
  • Sidebar

    Sidebar

    234
  • Tabs

    Tabs

    60
  • Newsletter Signup Footer

    Newsletter Signup Footer

    16
  • Progress Bar Stepper

    Progress Bar Stepper

    36
  • Footer 2

    Footer 2

    201
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    43
  • Navbar

    Navbar

    71
  • Pagination

    Pagination

    86