scrollxui

Folder Tree

Navigation 11

About

A collapsible folder/file tree component for displaying hierarchical data with expandable nodes, selection, keyboard navigation, and file/folder icons.

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

Code

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

Usage.tsx

import FolderTree from "@/components/ui/folder-tree";

export default function FolderTreeDemo() {
  return (
    <div className="w-full max-w-sm">
      <FolderTree.Root
        defaultExpanded={["root", "folder1"]}
        defaultSelected="file1"
        className="w-full"
      >
        <FolderTree.Item id="root" label="Root Folder">
          <FolderTree.Content>
            <FolderTree.Item id="folder1" label="Documents">
              <FolderTree.Content>
                <FolderTree.Item id="file1" label="File 1.txt" />
                <FolderTree.Item id="file2" label="File 2.txt" />
                <FolderTree.Item id="file3" label="Image.png" />
              </FolderTree.Content>
            </FolderTree.Item>
          </FolderTree.Content>
        </FolderTree.Item>
      </FolderTree.Root>
    </div>
  );
}

Dependencies

More by scrollxui

View all
  • Contact with Globe

    Contact with Globe

    360
  • Features With Panel

    Features With Panel

    333
  • Hero Section with Cards

    Hero Section with Cards

    159
  • FAQ Accordion

    FAQ Accordion

    157
  • Logo Cloud Marquee

    Logo Cloud Marquee

    156
  • Particles

    Particles

    99
  • Hero With Pixel Background

    Hero With Pixel Background

    83
  • Testimonials Marquee

    Testimonials Marquee

    76

More in Navigation

View all
  • Sidebar

    Sidebar

    305
  • Navbar

    Navbar

    1
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    46
  • Stacked Circular Footer

    Stacked Circular Footer

    432
  • Progress Bar Stepper

    Progress Bar Stepper

    46
  • Breadrcrumb

    Breadrcrumb

    12
  • Tabs

    Tabs

    53
  • NavBar

    NavBar