# AI Code Review

An AI review of a pull request: a scan line sweeps the diff, comments open under the lines they flag, CI checks settle beside it and a risk gauge climbs with each finding. Apply fix rewrites the line word by word and the risk drops.

- Page and source: https://uibrik.com/components/ai-review
- Install (Pro, needs a license key, see https://uibrik.com/docs/pro): `npx shadcn@latest add @uibrik-pro/ai-review`
- Packages: none beyond React
- Import: `import { AiReview } from "@/components/uibrik/ai-review/ai-review"`

Where to use the AI Code Review React component:

- **AI dev tool landing pages**: Shows a review bot reading real code and fixing it in about fifteen seconds, without a video. Pairs with [Agent Trace](https://uibrik.com/components/agent-trace) and [Terminal Demo](https://uibrik.com/components/terminal-demo).
- **Code review products**: Feed it a real diff and your model's comments; onApply and onDismiss hook into your own patch flow. Pairs with [Tool Call](https://uibrik.com/components/tool-call).
- **Internal dashboards**: One PR's risk, checks and open findings on one card. Pairs with [Deploy Pipeline](https://uibrik.com/components/deploy-pipeline) and [Status Dashboard](https://uibrik.com/components/status-dashboard).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| color | `string` | `"#5b7bd6"` | Colour of the scan line and the review's highlights. |
| title / number / head / base | `string / number / string / string` |  | The pull request. |
| files | `{ path; oldStart?; newStart?; lines: { type: "add" \| "del" \| "ctx"; text }[] }[]` |  | The diff, one hunk per file. |
| comments | `ReviewComment[]` |  | The review's findings. |
| ReviewComment | `{ id; file; line; severity: "critical" \| "warning" \| "nit"; title; body?; fix? }` |  | line indexes into the file's lines. fix replaces the line; an empty string removes it. |
| checks | `{ name; status: "pass" \| "fail"; ms; detail? }[]` |  | CI checks. ms is when each settles in play mode. |
| applied / onApply | `string[] / (comment) => void` |  | Applied fixes (controlled) and the Apply fix handler. |
| dismissed / onDismiss | `string[] / (comment) => void` |  | Dismissed comments (controlled) and the Dismiss handler. |
| className | `string` |  | Classes for the card. |
