BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/neon-ui/branch-diff

BranchDiff

neon-ui/branch-diff
FreeComponent

Schema and row-level comparison between two branches with change counts, search, kind filters, and expandable DDL and word-level value diffs.

Install it

npx shadcn@latest add https://ui.neon.com/r/branch-diff.json

Source

src/components/branch-diff/branch-diff.tsxui.neon.com/r/branch-diff.json · first 6 KB
1"use client";
2
3import {
4 Alert02Icon,
5 ArrowDown01Icon,
6 ArrowRight01Icon,
7 GitBranchIcon,
8 Search01Icon,
9 Table01Icon,
10} from "@hugeicons/core-free-icons";
11import { HugeiconsIcon } from "@hugeicons/react";
12import { diffWordsWithSpace } from "diff";
13import { useMemo, useState } from "react";
14
15import {
16 Tabs,
17 TabsContent,
18 TabsIndicator,
19 TabsList,
20 TabsTrigger,
21} from "@/components/ui/tabs";
22import { cn } from "@/lib/utils";
23
24type ChangeKind = "added" | "removed" | "modified";
25type DiffTab = "schema" | "data";
26type DiffValue = boolean | number | string | null;
27
28interface BranchDiffBranch {
29 id: string;
30 name: string;
31}
32
33interface SchemaChange {
34 id: string;
35 kind: ChangeKind;
36 objectType: "table" | "column" | "index" | "constraint";
37 path: string[];
38 before?: string;
39 after?: string;
40 ddl?: string;
41 breaking?: boolean;
42}
43
44interface RowChange {
45 id: string;
46 kind: ChangeKind;
47 primaryKey: Record<string, DiffValue>;
48 before?: Record<string, DiffValue>;
49 after?: Record<string, DiffValue>;
50}
51
52interface TableDataDiff {
53 id: string;
54 schema: string;
55 table: string;
56 primaryKey: string[];
57 rows: RowChange[];
58 addedCount: number;
59 removedCount: number;
60 modifiedCount: number;
61 unchangedCount?: number;
62 hasMore?: boolean;
63}
64
65interface BranchDiffProps {
66 from: BranchDiffBranch;
67 to: BranchDiffBranch;
68 schemaChanges: SchemaChange[];
69 dataDiffs: TableDataDiff[];
70 tab?: DiffTab;
71 defaultTab?: DiffTab;
72 onTabChange?: (tab: DiffTab) => void;
73 onLoadMore?: (table: TableDataDiff) => void | Promise<void>;
74 loadingTableId?: string | null;
75 isLoading?: boolean;
76 error?: Error | string | null;
77 className?: string;
78}
79
80const KIND = {
81 added: {
82 className: "text-[var(--status-active)]",
83 label: "Added",
84 surface: "bg-[var(--status-active)]/8",
85 symbol: "+",
86 },
87 modified: {
88 className: "text-[var(--status-scaling)]",
89 label: "Modified",
90 surface: "bg-[var(--status-scaling)]/8",
91 symbol: "~",
92 },
93 removed: {
94 className: "text-destructive",
95 label: "Removed",
96 surface: "bg-destructive/7",
97 symbol: "−",
98 },
99} satisfies Record<ChangeKind, Record<string, string>>;
100
101const countSchemaKinds = (changes: SchemaChange[]) => ({
102 added: changes.filter((change) => change.kind === "added").length,
103 modified: changes.filter((change) => change.kind === "modified").length,
104 removed: changes.filter((change) => change.kind === "removed").length,
105});
106
107const countDataKinds = (tables: TableDataDiff[]) => {
108// … truncated

What it pulls in

npm packages

  • @hugeicons/react
  • @hugeicons/core-free-icons
  • diff

Other registry items

  • utils
  • https://ui.neon.com/r/tabs.json
  • https://ui.neon.com/r/neon-tokens.json

Files it writes

  • src/components/branch-diff/branch-diff.tsx
  • src/components/branch-diff/use-branch-diff.ts

Facts

Registry
neon-ui
Type
registry:component
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

ui.neon.com neondatabase/ui on GitHub Raw registry item This item as JSON

More from neon-ui

All 77 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ActivityFeedactivity-feedneon-uiComponentsFree2 deps
AgentChatagent-chatneon-uiComponentsFree6 deps
AnimatedWashanimated-washneon-uiComponentsFreeno deps · 2 files
ApiKeyListapi-key-listneon-uiComponentsFree2 deps
AppCardapp-cardneon-uiComponentsFree2 deps
AppCreatorapp-creatorneon-uiComponentsFree2 deps
AuthFormauth-formneon-uiComponentsFreeno deps
AutoscaleChartautoscale-chartneon-uiComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

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

BlockDex