Back to AIX Effects LibraryQA Verified · Synced
Layout & Gallery/<BeforeAfterSlider />·Beginner

Before / After Split Comparator

Built for media compression showcases, light/dark UI comparisons, and AI enhancement reveals without overflowing DOM widths.

Next.js 16+React 19TypeScriptTailwind CSSZero External Deps
Drag handle or use Arrow keys52%
Production Shader
Studio Enhanced
Unpolished Output
Raw Draft State
RAW WIREFRAMEAIX STUDIO

Drag split divider or use Left/Right keyboard arrows to compare.

Installation

Zero External Dependencies

Zero external packages needed.

Usage

import { BeforeAfterSlider } from '@/components/effects/library/layout/BeforeAfterSlider'

<BeforeAfterSlider
  orientation="horizontal"
  beforeSlot={<div className="h-64 p-6 bg-neutral-100">Before</div>}
  afterSlot={<div className="h-64 p-6 bg-[#0a0d18] text-white">After</div>}
/>

Props & API Reference

3 props
PropTypeDefaultDescriptionEffect
orientation'horizontal' | 'vertical''horizontal'Axis along which split divider sweeps.Switches horizontal vs vertical slicing.
positionnumber52Split percentage position across container (4..96).Controls divider offset cleanly.
handleColorstring'#536dfe'Divider line and drag handle border pigment.Styles scrubber handle.

More in Layout & Gallery

View All 36 →
Click any grid card to expand focus span
stiffness: 340 · damping: 28

Expandable Grid

Interactive 2-column Bento showcase that expands selected cards smoothly with spring reflow.

View Details
Hover or focus any card below
01 · OPTIC
Precision Card

Sharp contrast when focused.

02 · DEPTH
Neighbor Dimming

Sibling cards step back calmly.

03 · PURE CSS
Zero Packages

Works across mouse, touch & keyboard.

blur 2.5px · dim 0.42 · scale 1.03

Focus Gallery

Focused card sharpens and elevates cleanly while unselected siblings softly dim and blur.

View Details
Hover horizontally or drag slider
01 · Foreground
Primary Layer
02 · Midground
Offset Plane
03 · Horizon
Deep Axis

Depth Parallax Gallery

Three-layer card deck translating horizontally at proportional depth speeds inside perspective space.

View Details