EnterUI
DocsComponentsThemesExamplesDonation
Get Started
      • EmptySearchResult
      • SkeletonTable
      • LogViewer
      • JsonViewer
      • DiffViewer

Default usage

  1. EnterUI
  2. /Docs
  3. /Data and Analytics
  4. /Tables and Data
  5. /Data States and Tools
  6. /DiffViewer
Updated 3 October 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
NextMeter
On this page
  • Default usage
  • Import
  • Accessibility
  • API
  • Styling