BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ilinxa/card-tree

Card Tree

ilinxa/card-tree
FreeBlock

JSON-driven recursive card tree with a full structural editor — drag and drop, multi-select, permissions, search, validation, and undo.

Install it

npx shadcn@latest add https://ui.ilinxa.com/r/card-tree.json

Source

src/registry/components/data/card-tree/card-tree.tsxui.ilinxa.com/r/card-tree.json · first 6 KB
1"use client";
2
3import {
4 forwardRef,
5 useCallback,
6 useEffect,
7 useImperativeHandle,
8 useMemo,
9 useReducer,
10 useRef,
11 useState,
12} from "react";
13import {
14 DndContext,
15 type DragEndEvent,
16 type DragStartEvent,
17} from "@dnd-kit/core";
18import {
19 SortableContext,
20 verticalListSortingStrategy,
21} from "@dnd-kit/sortable";
22import { cn } from "@/lib/utils";
23import type {
24 CardAddedEvent,
25 CardDuplicatedEvent,
26 CardMovedEvent,
27 CardRemovedEvent,
28 CardRenamedEvent,
29 CustomPredefinedKey,
30 EffectivePermissions,
31 FieldAddedEvent,
32 FieldEditedEvent,
33 FieldRemovedEvent,
34 LevelStyle,
35 MetaAddedEvent,
36 MetaChangedEvent,
37 MetaRemovedEvent,
38 PredefinedAddedEvent,
39 PredefinedEditedEvent,
40 PredefinedKey,
41 PredefinedRemovedEvent,
42 CardTreeHandle,
43 CardTreeJsonNode,
44 CardTreeProps,
45 SearchMatch,
46 SearchOptions,
47} from "./types";
48import { parseInput, type ParseError, type ParsedCardTree } from "./lib/parse";
49import { serializeTree, treeToJsonNode } from "./lib/serialize";
50import {
51 createInitialState,
52 findAncestorIds,
53 findCard,
54 findParentId,
55 reducer,
56 visibleIdsInOrder,
57 type DefaultCollapsed,
58 type CardTreeAction,
59 type CardTreePredefinedEntry,
60 type CardTreeState,
61} from "./lib/reducer";
62import {
63 validateCardRename,
64 validateCardRemove,
65 validateFieldAdd,
66 validateFieldEditKey,
67 validateFieldEditValue,
68 validateMetaAdd,
69 validateMetaEdit,
70 validatePredefinedShape,
71} from "./lib/validate-edit";
72import {
73 runHostValidators,
74 type AnyChangeEvent,
75 type ValidatorKey,
76} from "./lib/validators";
77import type { FlatFieldType } from "./lib/infer-type";
78import { useTreeKeyboard } from "./hooks/use-tree-keyboard";
79import { useEditMode } from "./hooks/use-edit-mode";
80import { isDirty as isDirtySelector } from "./hooks/use-dirty";
81import { usePermissions } from "./hooks/use-permissions";
82import { useDndSensors, collisionStrategy } from "./hooks/use-dnd-config";
83import { useSearch } from "./hooks/use-search";
84import { useUndo } from "./hooks/use-undo";
85import { Card, type CardConfig, type EditDispatchers, type EditValidators } from "./parts/card";
86import { EmptyTreePlaceholder } from "./parts/empty-tree";
87
88/* ───────── default level styles ───────── */
89
90const DEFAULT_LEVEL_STYLES: LevelStyle[] = [
91 { containerClassName: "rounded-xl border border-border bg-card px-3 py-3 shadow-sm" },
92 { containerClassName: "rounded-lg border border-border bg-muted/30 px-3 py-2.5" },
93// … truncated

What it pulls in

npm packages

  • lucide-react
  • @dnd-kit/core
  • @dnd-kit/sortable
  • @dnd-kit/utilities

Other registry items

  • popover

Files it writes

  • src/registry/components/data/card-tree/card-tree.tsx
  • src/registry/components/data/card-tree/index.ts
  • src/registry/components/data/card-tree/types.ts
  • src/registry/components/data/card-tree/hooks/use-bulk-selection.ts
  • src/registry/components/data/card-tree/hooks/use-collapse-state.ts
  • src/registry/components/data/card-tree/hooks/use-dirty.ts
  • src/registry/components/data/card-tree/hooks/use-dnd-config.ts
  • src/registry/components/data/card-tree/hooks/use-edit-mode.ts
  • src/registry/components/data/card-tree/hooks/use-permissions.ts
  • src/registry/components/data/card-tree/hooks/use-search.ts
  • src/registry/components/data/card-tree/hooks/use-selection.ts
  • src/registry/components/data/card-tree/hooks/use-tree-focus.ts
  • src/registry/components/data/card-tree/hooks/use-tree-keyboard.ts
  • src/registry/components/data/card-tree/hooks/use-undo.ts
  • src/registry/components/data/card-tree/lib/bulk-actions.ts
  • src/registry/components/data/card-tree/lib/classify-key.ts
  • src/registry/components/data/card-tree/lib/dnd-helpers.ts
  • src/registry/components/data/card-tree/lib/infer-type.ts
  • src/registry/components/data/card-tree/lib/parse.ts
  • src/registry/components/data/card-tree/lib/permissions.ts
  • src/registry/components/data/card-tree/lib/reducer.ts
  • src/registry/components/data/card-tree/lib/search.ts
  • src/registry/components/data/card-tree/lib/serialize.ts
  • src/registry/components/data/card-tree/lib/validate-edit.ts
  • src/registry/components/data/card-tree/lib/validators.ts
  • src/registry/components/data/card-tree/parts/bulk-toolbar.tsx
  • src/registry/components/data/card-tree/parts/card-actions.tsx
  • src/registry/components/data/card-tree/parts/card-header.tsx
  • src/registry/components/data/card-tree/parts/card-title-edit.tsx
  • src/registry/components/data/card-tree/parts/card.tsx
  • src/registry/components/data/card-tree/parts/drag-handle.tsx
  • src/registry/components/data/card-tree/parts/drop-indicator.tsx
  • src/registry/components/data/card-tree/parts/empty-tree.tsx
  • src/registry/components/data/card-tree/parts/field-add.tsx
  • src/registry/components/data/card-tree/parts/field-edit.tsx
  • src/registry/components/data/card-tree/parts/field-row.tsx
  • src/registry/components/data/card-tree/parts/inline-error.tsx
  • src/registry/components/data/card-tree/parts/match-highlight.tsx
  • src/registry/components/data/card-tree/parts/meta-edit.tsx
  • src/registry/components/data/card-tree/parts/meta-inline.tsx

Facts

Registry
ilinxa
Type
registry:block
Access
Free
Files written
51
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

ui.ilinxa.com ilinxa/pro-ui on GitHub Raw registry item This item as JSON

More from ilinxa

All 184 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Account Switcheraccount-switcherilinxaBlocksFree1 dep · 10 files
Account Switcher (deprecated alias)account-switcher-01ilinxaBlocksFreeno deps
Account Switcher — fixturesaccount-switcher-fixturesilinxaBlocksFreeno deps
App Sidebarapp-sidebarilinxaBlocksFree1 dep · 37 files
App Sidebar — fixturesapp-sidebar-fixturesilinxaBlocksFreeno deps
Rich Text Editor (deprecated alias)article-body-01ilinxaBlocksFreeno deps
Article Metaarticle-metailinxaBlocksFree1 dep · 4 files
Article Meta (deprecated alias)article-meta-01ilinxaBlocksFreeno deps
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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

© 2026 BlockDex. A Kynth Studios product.

BlockDex