# Motion Compare Slider

Before and after image comparison slider.

- id: `motion-compare-slider`
- Page: https://agentic-ui-kit.com/components/motion-compare-slider
- Live preview: https://agentic-ui-kit.com/live/component/motion-compare-slider?piece=motion-compare-slider

## Install

```bash
agentic-ui add motion-compare-slider
npx shadcn@4.17.0 add @agentic-ui/motion-compare-slider
```

## Metadata

- **Level:** block
- **Category:** motion
- **Installable in:** Radix UI (registry variant new-york), Base UI (registry variant base-vega)
- **Capabilities:** before-after-slider, any-two-elements, horizontal-or-vertical, native-range-keyboard, drag-or-hover-mode, touch-drag, intro-sweep, value-text-both-sides, change-callback, reduced-motion-fallback
- **Intents:** compare-over-time, explore-detail, communicate
- **Suits domains:** marketing, saas, ecommerce, media, ai-content, devtools
- **Interaction:** drag, keyboard-navigation, hover
- **Screen role:** detail
- **Density:** comfortable
- **Dark mode:** yes
- **Use it for:** before and after image comparison slider, drag to compare two screenshots or designs, draggable divider that reveals the new version over the old, vertical compare slider for two stacked states
- **Avoid when:** A comparison section with metrics and copy around it (use marketing-before-after), More than two states (use tabs or a table), Content that cannot share one frame and aspect ratio, Numeric ranges where a form control is needed (use a slider input)
- **Preserve when adapting:** native-range-input, value-text-names-both-sides, clip-by-custom-property, touch-action
- **Replace when adapting:** before, after, labels, orientation, aspect-ratio, start-value, mode, intro
- **Adaptation effort:** low
- **Coupling:** low
- **Quality breakdown:** visual 9/10, responsive 9/10, accessibility 9/10, code 9/10
- **npm dependencies:** @agentic-ui/motion, @agentic-ui/tokens, react
- **Motion:** profile subtle, library css, reduced-motion fallback yes, target 60 fps
- **Registry dependencies:** lib-motion
