Output Diff
ProNewTwo 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
| Prop | Type | Default |
|---|---|---|
| prompt* | stringThe input both runs were given. | — |
| expected | stringWhat a correct answer contains, if there is a reference. | — |
| before* | DiffSide | — |
| after* | DiffSide | — |
| className | string | — |
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.