media
Before / After
An aligned media comparison driven by a native range.
- media
- comparison
- drag
- range
Live preview
Quick usage
import { BeforeAfter } from "@pinky-ui/systems";
<BeforeAfter before={before} after={after} />Presets
Default
Restrained production behaviour.
Default behaviour
Quiet
Reduced intensity for dense product screens.
disabled={true}
Install
Add @pinky-ui/systems as a dependency, or use the CLI to copy this component's source directly into your project — no dependency to manage, fully editable.
npm install @pinky-ui/systemspnpm add @pinky-ui/systemsyarn add @pinky-ui/systemsnpx pinky-ui add before-afterPrefer to run the whole repository locally instead?
git clone https://github.com/florash/Pinky-UI.git
cd Pinky-UI
npm install
npm run devProps
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | 50 | Controlled reveal percentage. |
| className | string | — | Styles the outer interaction surface. |
Accessibility
- Keyboard and touch paths match the pointer interaction.
- Stable labels and values remain available without motion.
Performance
- One clipped overlay; no canvas or pointer-frame React loop.
Reduced motion
Motion resolves immediately while semantics, focus and state remain unchanged.
When to use
- Redesign, editing and restoration comparisons
When not to use
- Unaligned or misleading images
Skill
Purpose
BeforeAfter compares two aligned visual states with one native range control. Use it for redesigns, editing, restoration and honest product comparisons.
Both layers need labels and equivalent dimensions. Avoid misleading crops, unrelated imagery or using the slider when side-by-side comparison is clearer. The position must respond to arrows, touch and a controlled value without requiring drag precision.
Keep tactile feedback small and preserve the native range semantics. Reduced motion removes thumb flourish, not control behaviour. Compose with captions that explain what changed; never let color alone carry the comparison.