A component used to showcase the folder and file structure of a directory.
7,609
Bookmarks
9,809
Installs
12,409
Views
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 plansThat's all 6 components
Part of Magic UI — browse the full library on Nuxus.