Two minimal OpenTUI apps that embed HunkDiffView directly.
For package install and API details, see OpenTUI component docs.
bun run examples/7-opentui-component/from-files.tsx
bun run examples/7-opentui-component/from-patch.tsx- embedding
HunkDiffViewinside a normal OpenTUI app shell - building
diff.metadatawithparseDiffFromFile - parsing raw unified diff text with
parsePatchFiles - switching between split and stacked layouts with example shell controls
- a scrollable terminal diff component that other OpenTUI apps can reuse
The in-repo demos import from ../../src/opentui so they run from source. Published consumers should import from hunkdiff/opentui instead.