diffs

Use when an app uses @pierre/diffs to render or edit code files, diffs, patches, merge conflicts, or CodeView review surfaces, including React, vanilla JavaScript, SSR, workers, annotations, selection, and custom Shiki languages or themes.

Install
npx skills add 'https://github.com/pierrecomputer/pierre/tree/main/skills/diffs'
Download bundle ↓
main · 1831817Scanned 2026-09-15

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

Recipe: render with React

Select a surface

Input or layoutComponent
One FileContents objectFile
Old and new FileContents objectsMultiFileDiff
Existing FileDiffMetadataFileDiff
One unified patch stringPatchDiff
One file with merge conflictsUnresolvedFile
One scroll region with many files and diffsCodeView

Use MultiFileDiff when the app has old and new file contents:

import { MultiFileDiff } from '@pierre/diffs/react';

<MultiFileDiff
  oldFile={{ name: 'src/value.ts', contents: oldSource }}
  newFile={{ name: 'src/value.ts', contents: newSource }}
  options={{
    diffStyle: 'split',
    theme: 'pierre-dark',
  }}
/>;

Pass source data, annotations, and slot renderers as component props. Pass display, theme, interaction, and highlighting settings through options.

Keep file objects and option objects stable when their values do not change. Wrap a large standalone surface in Virtualizer. Use CodeView when one scroll region contains a list of files or diffs.

Use the matching preload function from @pierre/diffs/ssr when the server must render the initial highlighted markup.

Referenced from SKILL.md