1 variant
Image Compare
A before and after pair split by a divider you drag, built on a real range input so the keyboard works for free.
import { ImageCompare } from "@/components/registry/image-compare";
export function Grade() {
return (
<ImageCompare
aspect="16 / 10"
beforeSrc="/before.jpg"
beforeAlt="The shot before grading"
afterSrc="/after.jpg"
afterAlt="The graded shot"
/>
);
}93 more lines ship with an easeUI Pro license.
Buy a licenseInstall
$ bunx --bun shadcn add @easeui-pro/image-compare
Props
beforeSrcRequiredstringThe image on the left of the divider.
beforeAltRequiredstringBoth images are real content, so neither gets an empty alt.
afterSrcRequiredstringThe image on the right of the divider.
afterAltRequiredstringDescribe what changed, not just the subject.
beforeLabelstringDefault "Before"Corner pill on the left.
afterLabelstringDefault "After"Corner pill on the right.
aspectstringDefault "4 / 3"Reserved up front, so nothing on the page moves as the images load.
defaultValuenumberDefault 50Where the split starts, 0 to 100.
classNamestringMerged last, so anything passed here wins over the component's own classes.