Lemma Page Tree
lemma/lemma-page-treeFreeBlock
A hierarchical sidebar for doc-heavy apps backed by the pod file tree, with collapsible folders, selection highlighting, inline document creation, and an optional legacy record-wrapper mode.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/lemma-work/lemma-platform/main/lemma-typescript/public/r/lemma-page-tree.jsonSource
1"use client"23import * as React from "react"4import {5 ChevronDown,6 ChevronRight,7 FileText,8 Folder,9 FolderOpen,10 Plus,11 RefreshCw,12} from "lucide-react"13import { Button } from "@/components/lemma/ui/button"14import { Skeleton } from "@/components/lemma/ui/skeleton"15import { useFileTree, useRecords } from "lemma-sdk/react"16import type {17 DatastoreDirectoryTreeNode,18 DatastoreFileNamespace,19 LemmaClient,20} from "lemma-sdk"21import { cn } from "@/components/lemma/lib/utils"22import { type EnumColorMap } from "./page-tree-enum-utils"23import {24 pageTreeRadiusClassName,25 type LemmaPageTreeAppearance,26 type LemmaPageTreeDensity,27 type LemmaPageTreeRadius,28} from "./page-tree-style-utils"2930export type {31 LemmaPageTreeAppearance,32 LemmaPageTreeDensity,33 LemmaPageTreeRadius,34} from "./page-tree-style-utils"35export type { EnumColorMap, EnumColorEntry } from "./page-tree-enum-utils"3637export type LemmaPageTreeDataSource = "files" | "records"3839export interface TreeNode {40 id: string41 label: string42 kind: "directory" | "file" | "record"43 path?: string44 record?: Record<string, unknown>45 sourceNode?: DatastoreDirectoryTreeNode46 iconText?: string | null47 children: TreeNode[]48}4950export interface LemmaPageTreeProps {51 client: LemmaClient52 podId?: string53 enabled?: boolean54 dataSource?: LemmaPageTreeDataSource5556 rootPath?: string57 filesPerDirectory?: number58 namespace?: DatastoreFileNamespace59 selectedPath?: string60 onSelect?: (node: TreeNode) => void61 onCreateDocument?: (directoryPath?: string) => void62 defaultExpandedPaths?: string[]6364 tableName?: string65 parentField?: string66 titleField?: string67 iconField?: string68 selectedId?: string69 onPageClick?: (payload: Record<string, unknown> | TreeNode) => void70 onCreatePage?: (parentId?: string) => void71 defaultExpandedIds?: string[]72 onReorder?: (recordId: string, newParentId: string | null, newIndex: number) => void73 enumColorMap?: EnumColorMap7475 appearance?: LemmaPageTreeAppearance76 density?: LemmaPageTreeDensity77 radius?: LemmaPageTreeRadius78 title?: React.ReactNode79 className?: string80}8182export function LemmaPageTree({83 client,84 podId,85 enabled = true,86 dataSource,87 rootPath = "/",88 filesPerDirectory = 3,89 namespace = "POD",90 selectedPath,91 onSelect,92 onCreateDocument,93 defaultExpandedPaths,94 tableName,95 parentField = "parent_page_id",96 titleField = "title",97 iconField,98 selectedId,99 onPageClick,100 onCreatePage,101 defaultExpandedIds,102 onReorder,103// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from lemma
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Lemma Action Surfacelemma-action-surface | lemma | Blocks | Free | 4 deps | |
| Lemma Activity Feedlemma-activity-feed | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Agent Conversation Experiencelemma-assistant-experience | lemma | Blocks | Free | 7 deps · 3 files | |
| Lemma Breadcrumbslemma-breadcrumbs | lemma | Blocks | Free | 3 deps | |
| Lemma Commentslemma-comments | lemma | Blocks | Free | 4 deps · 3 files | |
| Lemma Detail Panellemma-detail-panel | lemma | Blocks | Free | 4 deps · 7 files | |
| Lemma Document Workspacelemma-document-workspace | lemma | Blocks | Free | 6 deps | |
| Lemma File Browserlemma-file-browser | lemma | Blocks | Free | 4 deps |
