Diff Viewer
Side-by-side and unified text diff with line numbers and word-level highlights, stacking to unified on narrow screens.
Copy a prompt for your AI coding tool with the source, dependencies and usage
Props
DiffViewerProps
Also accepts all props of Omit<React.ComponentProps<"div">, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
| oldText* required | string | — | — |
| newText* required | string | — | — |
| filename | string | — | File name or title shown in the header |
| defaultMode | DiffMode | — | — |
Install
$ npx shadcn@latest add https://chromotion.dev/r/diff-viewer.json