Skip to content
nexubDesign System
v11.9.0

Components · AI

Diff View

BetaAdded v4.8.0

A unified diff with added and removed lines, for agent changes.

import { DiffView } from '@nexub/react';
View as Markdown

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',
};
TSX
<DiffView className="w-full" diff={diff} file="templates/reminder.ts" />

Examples

Proposed change

templates/reminder.ts
@@ -3,4 +3,4 @@
export const reminder = {
Removed: subject: 'Invoice overdue',
Added: subject: 'A friendly reminder about your invoice',
tone: 'polite',
};

Props

Props
PropTypeDefaultDescription
diffrequiredstring—Unified diff text.
filestring—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