Measured entry

ruixen-glass-image-compare

feature-gridliquid-glassmotion on file

A client-side React before-and-after image slider distributed as a single shadcn registry TSX file. It embeds its own light and dark glass styling, uses Motion for clipping and drag animation, and calls browser file, pointer, and audio APIs for local image loading and optional feedback.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of ruixen-glass-image-compare at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of ruixen-glass-image-compare at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of ruixen-glass-image-compare at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

Measured

Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.

Harness measurements recorded for ruixen-glass-image-compare
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious1
Axe moderate0
Axe minor0
Gzip marginal63.4 KB (128.8 KB build, 65.4 KB baseline)
Bare modeOK
Provider requiredNO
Demo usedwritten from the component source API

Verdict

A credible drop-in for visual demos and editing tools: it builds, mounts without framework scaffolding, and stays contained across the tested layouts. Adopt it only with an accessibility pass for contrast, slider semantics, focus, and keyboard control.

Use it if

  • You need an interactive before-and-after comparison that accepts image URLs or local uploads.
  • Your interface already permits client-side Motion components and pointer-driven interactions.
  • You want a compact comparison card with editable labels, position callbacks, and optional sound.

Skip it if

  • You require a keyboard-operable comparison control without modifying the component.
  • Your release gate rejects the current low-contrast empty-state text.
  • You cannot justify adding Motion for one comparison widget.
  • Your product forbids local file input or browser audio behavior.

Install

Installation record for ruixen-glass-image-compare
Declared dependenciesmotion
Missing on installnone
Bare installbuilds and mounts without the shadcn-style helpers
Providerno provider required in the harness

In a non-shadcn React project, add Motion, copy the client TSX file into your component tree, and import the named component. No utility CSS package or provider is required because the styles are embedded. Supply both image sources for the comparison view, and disable sound if browser audio is not appropriate.

Source and credit

This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.

Alternatives

Other published entries for the feature-grid pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.