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/reactSwipeMode
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
- Not using React? The same four modes ship as vanilla mount functions
- Every prop:
@blazediff/reactreference - The engine underneath:
@blazediff/uireference
Last updated on