Skip to content

Compare Slider

A before/after comparison with a draggable glass divider.

Plan
Pro · commercial license
Dependencies
React only
Props
11 (8 adjustable)

Included in Pro and Lifetime. See pricing

BeforeAfter

Made with Furin: Pill Nav · Metal Button · Copy Morph

Props

PropTypeDefaultDescription
beforeReactNode""The "before" scene. Defaults to an unretouched generated landscape.
afterReactNode""The "after" scene. Defaults to the same landscape, revealed.
beforeLabelstring"Before"Label on the left.
afterLabelstring"After"Label on the right.
defaultPositionnumber50Initial position of the divider, from 0 to 100.
onChange(position: number) => void""Called when the divider moves, with the value from 0 to 100.
trigger"drag" | "hover""drag"How the divider moves: by dragging, or by following the cursor.
introbooleantrueA welcome sweep that shows the divider can be moved.
ratiostring"4 / 3"Aspect ratio of the image, e.g. "4 / 3".
radiusnumber24Corner radius, in px.
refractionnumber1Strength of the divider lens's refraction (0 = light isn't bent).

Installation

With your license

1Set up the Pro registry once

Pro components aren't on npm or in the public shadcn registry: you install them with your license from Furin's private registry.

Use my license

2Install Compare Slider

npx shadcn@latest add @furin-pro/compare-slider

Dependencies

React
18 or later
Other libraries
none
License
commercial

Pro components install into your project: the code is yours and there's nothing else to download.

Keep exploring

  • Album covers in perspective with reflections: the center one faces you and the rest fan out. Arrows, drag with inertia, click and keyboard.

    Galleries

  • A column masonry grid that appears piece by piece as it scrolls into view, with a soft bounce and a flash; hovering a piece zooms it in and shows its title.

    Galleries

  • Cards with generated scenes on a 3D circular carousel: it spins on its own, drags with inertia, and a click brings a card to the front.

    Galleries