tuil
ReferenceComponentsLogs, JSON, and diffs

RichDiffViewer

RichDiffViewer component API, behavior, and executable example.

View rawEdit

Loading executable example…

API and events

Inspect streaming logs, expandable structured values, and line-oriented changes in terminal-bounded viewports.

export function RichDiffViewer(props: {
  readonly source: string;
  readonly mode?: "unified" | "split";
  readonly id?: string;
  readonly label?: string;
  readonly autoFocus?: boolean;
  readonly search?: string | RegExp;
  readonly collapseUnchangedAfter?: number;
  readonly onResolveHunk?: (
    index: number,
    decision: "apply" | "reject",
    content: string,
  ) => void | Promise<void>;
}): ReactNode;

Props, functions, and events

This declaration has no public members.

LogViewer reports follow state; JSON expansion can be controlled; pure transformation helpers emit nothing.

Callback props run after the documented input is accepted. Callbacks are not cancellable unless their return type or description states otherwise.

Interaction and capabilities

Viewers scroll and filter; JSON nodes expand or collapse; diff output remains deterministic in static mode.

The published manifest records keyboard, focus, pointer, theme, terminal, semantic, event, and dependency requirements.

Complete import

import { RichDiffViewer } from "@/components/tuil/data-display/log-viewer";

On this page