Skip to content
AI & AgentsPro

Diff View

The result of an edit tool call: file, added and removed lines, and the changed code.

Usage

@@ -41,3 +41,6 @@ TabsList

export function TabsList({ className, ...props }) {
Removed: return <div role="tablist" {...props} />
Added: const ref = useRovingFocus()
Added: return (
Added: <div ref={ref} role="tablist" {...props} />
Added: )
}

Installation

bash
npm install @wunderui/react

Then import what you need:

tsx
import { DiffView } from "@wunderui/react"

In context

How the component is used inside real screens — the same compositions as the Usage section of the Figma page.

Edit tool call in a run

The agent's edit_file call as it appears in the transcript: what it changed, folded open.

edit_file

Applied 1 file edit

Done

@@ -41,3 +41,6 @@ TabsList

export function TabsList({ className, ...props }) {
Removed: return <div role="tablist" {...props} />
Added: const ref = useRovingFocus()
Added: return (
Added: <div ref={ref} role="tablist" {...props} />
Added: )
}

API Reference

PropTypeDefault
fileReactNode—
hunks{ header?: string; lines: { type: "context" | "add" | "del"; old?: number; new?: number; content: string }[] }[]—
mode"unified" | "compact""unified"
additions / deletionsnumbercounted from the lines
defaultOpenbooleantrue