Getting Started
Overview
Installation
Theme
Forms
Basic Inputs
Select
Custom Inputs
Components
Navigation
Components
69
Micro Charts
Libraries
Kanban Board
Image Designer
Video Player
Visual Builder
Content Editor
Data View
Latest npm version of @ngstarter-ui/componentsWeekly npm downloads of @ngstarter-ui/components
Purchase

Comparison Slider

Comparison Slider compares two visual layers with a draggable vertical divider. Use it for before-and-after images, photo edits, design changes, product variations, UI before-and-after states, image processing results, maps, reports, and other visual diffs.

Use it for:
  • Comparing a baseline image with an edited or changed image.
  • Showing two matching visual states in the same size and perspective.
  • Letting users drag the handle to reveal more of the before or after layer.
  • Setting the starting divider position with initialPosition.

Always give the slider a stable width and height or aspect ratio. The before and after layers should match in size and perspective. Do not use Comparison Slider as a gallery, carousel, image viewer, range input, data table comparison, or text comparison tool.

PropTypeDefault
initialPosition
The initial position of the slider handle in percentage (0-100).
InputSignal<number>50
DirectiveDescription
ngsComparisonSliderBeforeImageDirective to identify the "before" image in the slider.
ngsComparisonSliderAfterImageDirective to identify the "after" image in the slider.