Skip to Content
New: ssim-native brings SSIM, MS-SSIM and Hitchhiker's to Node, and interpret-native ships diff interpretation on its own. Read more β†’

Vanilla Components

@blazediff/ui gives you the same four comparison modes as the React package, mounted into any DOM node. Each demo below is the real thing, running in this page.

Every mount* call returns a { update, destroy } handle: update(options) swaps sources or options in place, destroy() tears the UI down. Underneath sits a headless engine you can drive directly from Vue, Svelte, Solid or your own renderer, which is what the React package does.

Installation

npm install @blazediff/ui
import { mountSwipe } from "@blazediff/ui"; // A draggable divider over two stacked images. position is 0 to 100. const handle = mountSwipe(document.getElementById("app"), { src1: "before.png", src2: "after.png", onPositionChange: (position) => console.log(position), });

Next

Last updated on