43 Pro components and page blocks

Get Pro

Compare Slider

New

Preview

Customize

Start position50%
Horizontal
Radius20px

Usage

import { CompareSlider } from "@/components/uibrik/compare-slider/compare-slider";

<CompareSlider before={before} after={after} />

Installation

npx shadcn@latest add https://uibrik.com/r/compare-slider.json
Adds the files to components/uibrik/compare-slider and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/compare-slider.

Props

CompareSlider
beforeLabel
Type string
"Raw"
Label on the start side. Empty hides it.
afterLabel
Type string
"Graded"
Label on the end side. Empty hides it.
defaultPosition
Type number
50
Where the handle starts.
orientation
Type "horizontal" | "vertical"
"horizontal"
Wipe left to right, or top to bottom.
intro
Type boolean
true
Sweep the handle in from the far edge the first time it scrolls into view.
hover
Type boolean
false
Move the handle with the mouse, without pressing.
radius
Type number
20
Corner radius.
beforerequired
Type ReactNode
–
The start layer, usually an <img>. Images fill and cover the frame.
afterrequired
Type ReactNode
–
The end layer, laid exactly over the start one.
onChange
Type (position: number) => void
–
Called with the handle position, 0–100.
className
Type string
–
Classes for the frame. Give it a size or aspect ratio.