Skip to content

AI interfacesLumen Halo

File DiffProv1.0.0

A change to one file, read the way a reviewer reads it: old and new line numbers, a soft green or red wash on changed lines that screen readers hear as Added and Removed, long unchanged stretches folded away, and a header that counts the change and copies the patch.

Built on shadcn/ui

.md
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-file-diff

Needs your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.

Styles didn't apply?

The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt
Collapsible

Usage

Import it and pass your content. The props that matter most are listed next.

Example
"use client";

import { FileDiff } from "@/components/ui/lumen/controls/file-diff";

const patch = `--- a/config/alerts.yaml
+++ b/config/alerts.yaml
@@ -3,4 +3,5 @@ alerts:
   - metric: trial_conversion
     window: 7d
-    drop: 25%
+    drop: 15%
+    notify: "#growth"
     owner: growth
`;

export function ProposedChange() {
  return <FileDiff patch={patch} collapsible />;
}

Props

  • patch–

    string

    A unified diff (git diff, diff -u). Hunks, numbers and the file name are read from it.

  • lines / oldStart / newStart–

    DiffLine[] / number

    Or the lines: { type: "+" | "-" | " ", text }, Agent Run's shape, numbered from the starts (default 1).

  • file–

    string

    The path; read from the patch when omitted.

  • context3

    number

    Unchanged lines kept around each change; longer stretches fold.

  • copy"patch"

    "patch" | "after" | false

    What Copy copies: the patch, the new text, or no button.

  • collapsible / defaultOpenfalse / true

    boolean

    The header opens and closes the changes.

Show all 7 props
  • labels–

    Partial<FileDiffLabels>

    Every word, for other languages.

Source

components/ui/lumen/controls/file-diff.tsx

This component is included with Pro.

Try the live preview above. Get Pro to install the source.