tree-actions

PreviousNext
Docs
takiexample

Preview

Loading preview…
registry/new-york/examples/tree-actions.tsx
"use client"

import { InfoIcon } from "lucide-react"

import { Button } from "@/registry/new-york/ui/button"
import { Tree, TreeItem } from "@/registry/new-york/ui/tree"

export default function TreeActionsDemo() {
  return (
    <Tree
      aria-label="Files"
      className="w-80"
      defaultExpandedKeys={["documents", "photos"]}
    >
      <TreeItem id="documents" title="Documents">
        <TreeItem id="project" title="Project">
          <TreeItem id="report" title="Weekly Report" />
        </TreeItem>
      </TreeItem>
      <TreeItem id="photos" title="Photos">
        <TreeItem id="vacation" title="Vacation" />
      </TreeItem>
    </Tree>
  )
}

Installation

npx shadcn@latest add @taki/tree-actions

Usage

import { TreeActions } from "@/components/tree-actions"
<TreeActions />