Skip to Content
New: codec-png-native and codec-png-wasm bring the blazediff-png codec to Node and WebAssembly, faster than spng and jSquash. Read more β†’
DocsIn a UIReact

React Components

@blazediff/react renders a before/after comparison four ways: swipe, two-up, onion skin, and a live pixel diff. Every demo below is the real component, running in this page.

The components carry no styling of their own. They take *ClassName props and render from the @blazediff/ui headless engine, so you can restyle them freely or drop to the engine and render your own markup.

Installation

npm install @blazediff/react
import { SwipeMode } from "@blazediff/react"; // A draggable divider over two stacked images. position is 0 to 100. <SwipeMode src1="before.png" src2="after.png" onPositionChange={(position) => console.log(position)} />

Next

Last updated on