Skip to content
↑↓ to navigate↵ to openesc to close

Menu

File Diff

Preview

File changes

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/file-diff

Import the shared styles once in your application.

TSUsage
import FileDiff from '@/components/beui/agents/FileDiff.vue'
import '@/components/beui/styles.css'

API Reference

file
string
Default—
lines
FileDiffLine[]
Default—
status?
"streaming" | "complete"
Defaultstreaming
v-model:open?
boolean
Defaultundefined
defaultOpen?
boolean
Defaulttrue
collapseOnComplete?
boolean
Defaulttrue
maxHeight?
number
Default220
language?
string
Defaulttypescript
copyText?
string
Default—
onCopy?
() => void | Promise<void>
Default—
labels?
Labels

Override any built-in string.

Default—
class?
string
Default—
@open-change?
(value: boolean) => void
Default—

Composition

Place the patch inside the tool output that produced the file change.

ToolResult
└── ToolResultOutput
    └── FileDiff

Note: Code Block provides the shared syntax presentation for source lines. Tool Result summarizes the command or edit that produced the patch. Agent Activity records the file edit among surrounding agent events.

How it works

A file diff explains a proposed or completed edit. It should preserve the relationship between old and new lines while making the scale and status of the change visible at a glance.

Also on React Native. Changes with live counts and folded context.(opens in a new tab)

Updated