Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Diff Table

ProNew

A reviewable set of edits from an agent: old value struck out, new value beside it, accept row by row.

Installation

pnpm dlx shadcn@latest add @viewport/diff-table

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
title*string

What the changes are for, e.g. "Update customer record".

—
changes*DiffChange[]—
defaultSelectedstring[]

Ids ticked at the start. Defaults to every change.

—
onApply(ids: string[]) => void

Called with the ids of the accepted changes.

—
onDiscard() => void

Called when the proposal is dismissed. Omit to hide the button.

—
classNamestring—

Accessibility

  • A real table: each field is a row header and labels its checkbox.
  • Old and new values are del and ins elements.
  • Select all reports a mixed state; the outcome is announced as a status.