Skip to main content

Image Compare

Compare a before & an after under one divider, dragged across or moved with the arrow keys.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
beforestring-The picture on the left, before the change.
The picture on the left, before the change.
afterstring-The picture on the right, after it.
The picture on the right, after it.
altstring-What both pictures show, for screen readers.
What both pictures show, for screen readers.
beforeLabelstringBefore
afterLabelstringAfter
defaultPositionnumber50Where the divider starts, in percent from the left.
Where the divider starts, in percent from the left.
aspectRatiostring16 / 10The frame's width over its height, such as 16 / 10.
The frame's width over its height, such as 16 / 10.
shapenone | rounded | pillrounded
classNamestring-
focusboolean | stringtrue