# Diff review — Detent

> Code an agent wants to change, reviewed hunk by hunk. Lines stream in, verdicts stamp down, and unified slides into split.

Canonical: https://detentui.com/components/diff
Last updated: 2026-11-10

## About

Code an agent wants to change, reviewed hunk by hunk. Lines stream in, verdicts stamp down, and unified slides into split.

## Details

- Lines stream in as the agent writes them, and the counts in the header roll up with each one.
- Every row is placed from a layout model, so unified to split is a single spring: removed lines slide left to sit beside their replacements.
- Accepting a hunk resolves it into the final code; rejecting it puts the old lines back. The removed side fades where it stood.
- The words that actually changed are marked inside each line, and lines too different to compare are left unmarked.
- Verdicts land like a rubber stamp, and each one moves you on to the next hunk that still needs a look.
- Buttons, stamps and the writing state share one fixed slot per hunk, so the header never shifts.

## Keyboard shortcuts

| Keys | Action |
| --- | --- |
| J / K | Next or previous hunk |
| A | Accept the hunk |
| R | Reject the hunk |
| U | Undo the verdict |
| S | Switch unified and split |
| ↵ | Apply when everything is reviewed |

## Install

```bash
npx shadcn add https://detentui.com/r/diff
```

## Related
- [All components](https://detentui.com/components)
- [Pro](https://detentui.com/pro)
