Skip to content
Tables

DiffTable

Renders code diffs in unified or split view with added/removed line counts, accept/reject hunk actions, and syntax-highlighted monospace display.

Preview:
1280px
11
@@ Changes @@
11 export function greet(name: string) {
2 return 'Hello, ' + name;
2+ return `Hello, ${name}!`;
33 }

Props

PropTypeDefaultDescription
hunksDiffHunk[]-Array of diff hunks to render.
mode'unified' | 'split''unified'Diff display mode.
onAccept(hunkId: string) => void-Fired when the user clicks Accept on a hunk.
onReject(hunkId: string) => void-Fired when the user clicks Reject on a hunk.