@pierre/diffs is an open source diff and code rendering library. Built on Shiki for syntax highlighting and theming, super customizable, and packed with features.
EditTreesDiffsHubPierrePlaygroundRendering DiffsMerge conflict resolution UIPackage ExportsBuild with agentsAgent skillPrompt an agentPlain-text docsCore TypesFileContentsFileDiffMetadataLineAnnotation and DiffLineAnnotationCreating DiffsReact APIPartial Diff HydrationShared PropsVanilla JS APIPropsRenderersCodeViewWhat It Gives YouCore ModelEditingPadding & GapHeader & FooterFile & Diff Size EstimationExamplesReact Item OwnershipEditing Item AnnotationsUsage NotesScroll TargetsRelationship To VirtualizationEdit modeEnable editingHandle changes and completionRetain edit state in memoryInitialize state on first attachPersist a draft across reloadsControl the editorExtend the editing UIPerformance and loadingEdit predictionAPI referenceKeyboard shortcutsVirtualizationReactVanilla JSNotesHunk SeparatorsBuilt-in TypesCustom CSS ExampleUtilitiesAnnotation type guardsdiffAcceptRejectHunkresolveMergeConflictdisposeHighlightergetSharedHighlighterparseDiffFromFileparsePatchFilestrimPatchContextpreloadHighlighterregisterCustomThemeregisterCustomLanguagesetLanguageOverrideStylingAdvanced: Unsafe CSSThemesToken HooksWorker PoolSetupUsageRender CacheArchitectureSSRPreloadersHighlightsHTMLTokensStreamingIncremental editingLanguagesSplit Diff View (Side-by-side)Stacked Diff View (Unified)In-line Code EditorMerge Conflict Resolver UIComments & AnnotationsAccept / Reject ActionsLine Selection & Gutter IndicatorsToken Hover TooltipsShiki Theming EngineCustom Hunk Separators
@pierre/diffs is a state-of-the-art diff and code rendering library created by The Pierre Computer Company. Leveraging Shiki for robust grammar parsing and theme compatibility (supporting standard VS Code themes), it renders both split (side-by-side) and stacked (unified) diff layouts with exceptional performance. Features include inline editing, merge conflict resolution interfaces, review comment annotations, interactive token hovers, and chunk accept/reject workflows.