tree-view
shipbase-ui/tree-viewFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/tree-view.jsonSource
1"use client"23import * as React from "react"45import { TreeView as TreeViewPrimitive } from "@ark-ui/react/tree-view"67import { cn } from "@/lib/utils"89const TreeView = TreeViewPrimitive.Root1011const TreeViewProvider = TreeViewPrimitive.RootProvider1213const TreeViewContext = TreeViewPrimitive.Context1415const TreeViewTree = TreeViewPrimitive.Tree1617const TreeViewNodeProvider = TreeViewPrimitive.NodeProvider1819const TreeViewNodeContext = TreeViewPrimitive.NodeContext2021const TreeViewBranch = React.forwardRef<22 React.ElementRef<typeof TreeViewPrimitive.Branch>,23 TreeViewPrimitive.BranchProps24>(({ className, ...props }, ref) => (25 <TreeViewPrimitive.Branch26 ref={ref}27 className={cn("", className)}28 {...props}29 />30))31TreeViewBranch.displayName = "TreeViewBranch"3233const TreeViewBranchControl = React.forwardRef<34 React.ElementRef<typeof TreeViewPrimitive.BranchControl>,35 TreeViewPrimitive.BranchControlProps36>(({ className, ...props }, ref) => (37 <TreeViewPrimitive.BranchControl38 ref={ref}39 className={cn(40 "flex w-full items-center gap-2 rounded-md px-2 py-1 text-primary hover:bg-muted",41 className42 )}43 {...props}44 />45))46TreeViewBranchControl.displayName = "TreeViewBranchControl"4748const TreeViewBranchTrigger = TreeViewPrimitive.BranchTrigger4950const TreeViewBranchIndicator = TreeViewPrimitive.BranchIndicator5152const TreeViewBranchText = TreeViewPrimitive.BranchText5354const TreeViewBranchIndentGuide = React.forwardRef<55 React.ElementRef<typeof TreeViewPrimitive.BranchIndentGuide>,56 TreeViewPrimitive.BranchIndentGuideProps57>(({ className, ...props }, ref) => (58 <TreeViewPrimitive.BranchIndentGuide59 ref={ref}60 className={cn(61 "absolute top-0 left-2 h-full w-px rounded bg-border",62 className63 )}64 {...props}65 />66))67TreeViewBranchIndentGuide.displayName = "TreeViewBranchIndentGuide"6869const TreeViewBranchContent = React.forwardRef<70 React.ElementRef<typeof TreeViewPrimitive.BranchContent>,71 TreeViewPrimitive.BranchContentProps72>(({ className, ...props }, ref) => (73 <TreeViewPrimitive.BranchContent74 ref={ref}75 className={cn("relative pl-4", className)}76 {...props}77 />78))79TreeViewBranchContent.displayName = "TreeViewBranchContent"8081const TreeViewItem = React.forwardRef<82 React.ElementRef<typeof TreeViewPrimitive.Item>,83 TreeViewPrimitive.ItemProps84>(({ className, ...props }, ref) => (85 <TreeViewPrimitive.Item86 ref={ref}87 className={cn(88// … truncated
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| avataravatar | shipbase/ui | Components | Free | 1 dep | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| checkboxcheckbox | shipbase/ui | Components | Free | 2 deps | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps |
