BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/lemma/lemma-page-tree

Lemma Page Tree

lemma/lemma-page-tree
FreeBlock

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.json

Source

registry/default/lemma-page-tree/components/lemma-page-tree.tsxraw.githubusercontent.com/lemma-work/lemma-platform/main/lemma-typescript/public/r/lemma-page-tree.json · first 6 KB
1"use client"
2
3import * 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"
29
30export type {
31 LemmaPageTreeAppearance,
32 LemmaPageTreeDensity,
33 LemmaPageTreeRadius,
34} from "./page-tree-style-utils"
35export type { EnumColorMap, EnumColorEntry } from "./page-tree-enum-utils"
36
37export type LemmaPageTreeDataSource = "files" | "records"
38
39export interface TreeNode {
40 id: string
41 label: string
42 kind: "directory" | "file" | "record"
43 path?: string
44 record?: Record<string, unknown>
45 sourceNode?: DatastoreDirectoryTreeNode
46 iconText?: string | null
47 children: TreeNode[]
48}
49
50export interface LemmaPageTreeProps {
51 client: LemmaClient
52 podId?: string
53 enabled?: boolean
54 dataSource?: LemmaPageTreeDataSource
55
56 rootPath?: string
57 filesPerDirectory?: number
58 namespace?: DatastoreFileNamespace
59 selectedPath?: string
60 onSelect?: (node: TreeNode) => void
61 onCreateDocument?: (directoryPath?: string) => void
62 defaultExpandedPaths?: string[]
63
64 tableName?: string
65 parentField?: string
66 titleField?: string
67 iconField?: string
68 selectedId?: string
69 onPageClick?: (payload: Record<string, unknown> | TreeNode) => void
70 onCreatePage?: (parentId?: string) => void
71 defaultExpandedIds?: string[]
72 onReorder?: (recordId: string, newParentId: string | null, newIndex: number) => void
73 enumColorMap?: EnumColorMap
74
75 appearance?: LemmaPageTreeAppearance
76 density?: LemmaPageTreeDensity
77 radius?: LemmaPageTreeRadius
78 title?: React.ReactNode
79 className?: string
80}
81
82export 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

  • lemma-sdk
  • lucide-react
  • clsx
  • tailwind-merge

Other registry items

  • lemma-ui

Files it writes

  • registry/default/lemma-page-tree/components/page-tree-enum-utils.ts
  • registry/default/lemma-page-tree/components/page-tree-style-utils.ts
  • registry/default/lemma-page-tree/components/lemma-page-tree.tsx

Facts

Registry
lemma
Type
registry:block
Access
Free
Files written
3
Licence
AGPL-3.0
First indexed
2026-08-03
Last confirmed
today

Go to the source

lemma.work lemma-work/lemma-platform on GitHub Raw registry item This item as JSON

More from lemma

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Lemma Action Surfacelemma-action-surfacelemmaBlocksFree4 deps
Lemma Activity Feedlemma-activity-feedlemmaBlocksFree4 deps · 3 files
Lemma Agent Conversation Experiencelemma-assistant-experiencelemmaBlocksFree7 deps · 3 files
Lemma Breadcrumbslemma-breadcrumbslemmaBlocksFree3 deps
Lemma Commentslemma-commentslemmaBlocksFree4 deps · 3 files
Lemma Detail Panellemma-detail-panellemmaBlocksFree4 deps · 7 files
Lemma Document Workspacelemma-document-workspacelemmaBlocksFree6 deps
Lemma File Browserlemma-file-browserlemmaBlocksFree4 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex