Components · AI
Diff View
BetaAdded v4.8.0
A unified diff with added and removed lines, for agent changes.
import { DiffView } from '@nexub/react';Playground
Props
templates/reminder.ts
@@ -3,4 +3,4 @@export const reminder = {Removed: subject: 'Invoice overdue',Added: subject: 'A friendly reminder about your invoice',tone: 'polite',};
<DiffView className="w-full" diff={diff} file="templates/reminder.ts" />Examples
Proposed change
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| diffrequired | string | — | Unified diff text. |
| file | string | — | File name above the diff. |
Accessibility
Screen reader
Added and removed lines are spelled out for screen readers; colour is not the only cue.
On iOS & Android
Web only
Diff View has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.