EEnterUI
DocsComponentsThemesDonation
Get Started
      • EmptySearchResult
      • SkeletonTable
      • LogViewer
      • JsonViewer
      • DiffViewer
EnterUIDocsData AnalyticsTables and DataData States and ToolsDiffViewer
Data AnalyticsUpdated 6 May 2026

DiffViewer

Diff viewer for audit / config / permission change surfaces with unified or split mode.

Diff viewer for audit / config / permission change surfaces with unified or split mode.

#Default usage

Permission diff

Switch to split mode for side-by-side review.

+2−2
11
{
2−
  "role": "member",
3−
  "permissions": ["read"]
2+
  "role": "admin",
3+
  "permissions": ["read", "write"]
44
}
Code
<DiffViewer
  oldValue={'{\n  "role": "member",\n  "permissions": ["read"]\n}'}
  newValue={'{\n  "role": "admin",\n  "permissions": ["read", "write"]\n}'}
/>

#Import

Code
import { DiffViewer, type DiffLine, type DiffMode } from "@froggdesign/enter-ui-react";

#Accessibility

Each diff line carries an aria-label naming Added line / Removed line / Unchanged line plus a leading + / − symbol so colour is never the only signal.

#API

  • oldValue + newValue: convenience inputs — line diff is computed via LCS.
  • lines: pre-computed DiffLine[] for surfaces that already produce a diff.
  • mode: "unified" (default) or "split".
  • hideLineNumbers: hide the line number columns.
  • hideToolbar: hide the count + copy toolbar.

#Styling

Every exported component accepts className. EnterUI styles use .eui-* classes and --eui-* variables mapped from FroggDesign theme tokens.

PreviousJsonViewer
NextUserMenu

On this page

  1. Default usage
  2. Import
  3. Accessibility
  4. API
  5. Styling