AI Diff Review - React Component | Kokonut UI

AI Diff Review

A coding agent's edits streaming in file by file, then reviewed per file with accept, reject and undo.

Install with

npx shadcn@latest add https://kokonutui.com/r/ai-diff-review.json, then show me how to use it.

Editing files

3 files changed +12−3

const POSTCODE = /^\[A-Z\]{1,2}\d\[A-Z\d\]? ?\d\[A-Z\]{2}$/i;

export function isPostcode(value: string) {
 return POSTCODE.test(value.trim());
}
const onSubmit = (data: Address) => {
 if (!isPostcode(data.postcode)) {
 return setError("Enter a valid postcode");
 }
 submit(data);
}
it("rejects an empty postcode", () => {
 expect(errorFor("")):toBe("Required");
 expect(errorFor("")):toBe("Enter a valid postcode");
});

Installation

AI Diff Review is a free, open-source React component in the Kokonut UI AI collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/ai-diff-review.tsx, so the code is yours to change.

Or add it by hand: install its packages, then copy the source from above into components/kokonutui/ai-diff-review.tsx.

npm install lucide-react motion

Usage

import AIDiffReview from "@/components/kokonutui/ai-diff-review";

export default function Example() {
  return <AIDiffReview />;
}

Props

FileChange

FileDecision

type FileDecision = "pending" | "accepted" | "rejected";

DiffHunk

DiffLine

Dependencies

Needs Version Comes from
lucide-react ^0.556.0 npm, installed by the CLI
motion ^12.23.25 npm, installed by the CLI
cn from lib/utils.ts shadcn init
React 19 Your app
Tailwind CSS 4 Your app

No provider, font or global CSS to set up: the file works as soon as it lands.

Additional Resources

Example Screenshot

Slash Command Menu