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

Output Diff

ProNew

Two runs of one test case, side by side or as one marked-up text with removed words struck and added words underlined, each with its verdict and score.

Installation

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

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
prompt*string

The input both runs were given.

—
expectedstring

What a correct answer contains, if there is a reference.

—
before*DiffSide—
after*DiffSide—
classNamestring—

Accessibility

  • Changes use del and ins elements, which screen readers announce.
  • Verdicts are an icon and a word, not only a color.
  • The view switch is a pair of pressed-state buttons.
  • Columns stack by the container's width.