Skip to content

Image Comparer ​

Loading...

flint-image-comparer — Compare two images side-by-side with a draggable slider.

  • Tag: <flint-image-comparer>
  • Class: FlintImageComparer

Import ​

ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintImageComparer } from '@getufy/flint-ui';

Usage ​

html
<flint-image-comparer></flint-image-comparer>

Properties ​

PropertyAttributeTypeDefaultDescription
positionpositionnumber50The position of the divider as a percentage (0–100).
disableddisabledbooleanfalseWhether the comparer is disabled.

Events ​

EventDetailDescription
flint-image-comparer-change&#123; position: number &#125;Fired when the position changes. Detail: &#123; position: number &#125;.

Slots ​

NameDescription
beforeThe before image (&lt;img&gt; or &lt;svg&gt;).
afterThe after image (&lt;img&gt; or &lt;svg&gt;).
handleCustom handle content (replaces the default arrows icon).

CSS Parts ​

NameDescription
baseThe component's base wrapper.
beforeThe container that wraps the before image.
afterThe container that wraps the after image.
dividerThe divider line that separates the images.
handleThe draggable handle.

CSS Custom Properties ​

PropertyDefault
--flint-image-comparer-divider-width—
--flint-image-comparer-divider-color—
--flint-image-comparer-handle-size—
--flint-image-comparer-handle-bg—
--flint-image-comparer-handle-border-color—
--flint-image-comparer-handle-icon-color—
--flint-image-comparer-border-radius—
--flint-image-comparer-aspect-ratio—
--flint-border-radius-full—
--flint-shadow-md—
--flint-primary-focus-ring—
--flint-shadow-lg—