Pricing

File Tree

A component used to showcase the folder and file structure of a directory.

7,609

Bookmarks

9,809

Installs

12,409

Views

88 lines
import { Tree } from "@/components/ui/file-tree"
import type { TreeViewElement } from "@/components/ui/file-tree"

export default function FileTreeDemo() {
  return (
    <div className="bg-background relative flex h-[300px] w-full max-w-sm flex-col items-center justify-center overflow-hidden rounded-lg border">
      <Tree
        className="bg-background overflow-hidden rounded-md p-2"
        initialSelectedId="button"
        initialExpandedItems={["src", "app", "components", "ui", "lib"]}
        elements={ELEMENTS}
      />
    </div>
  )
}

72 more lines behind a plan

Previews are free to watch. Reading and copying the full source needs a plan.

See plans
Dependencies
@radix-ui/react-accordionlucide-react
License
MIT License
Published
1/11/2025

Similar components

That's all 6 components

Explore more

Part of Magic UI — browse the full library on Nuxus.