Compare

Compare two items side by side with a slider.

PREVIEW

Compare is composed with Compare as the root, two CompareItem layers, and a CompareHandle containing the keyboard-accessible CompareIndicator.

Before
After
basic-demo

The handle can be styled freely — give the indicator a rounded background, custom icon, and shadow for a more prominent look.

handle-demo

Enable slideOnHover to update the slider position by hovering over the component.

hover-demo

Set orientation to vertical for a vertical comparison layout.

vertical-demo

Combine slideOnHover with controlled value for interactive chart reveals.

chart-demo

Bind the value with v-model when external UI needs to stay in sync with the slider.

Before
After
controlled-demo

Compare is not limited to images — any content can be placed inside the items for creative comparisons.

Amy Elsner
Developer
Pro
Storage7.2 GB / 10 GB
Amy Elsner
Developer
Pro
Storage7.2 GB / 10 GB
template-demo

Screen Reader

Compare uses a hidden range input for keyboard accessibility. The input supports aria-label, aria-labelledby, aria-valuemin, aria-valuemax, and aria-valuenow attributes. Use arrow keys to adjust the slider position.

Keyboard Support

KeyFunction
tabMoves focus to the component.
left arrowup arrowDecrements the value.
right arrowdown arrowIncrements the value.
homeSet the minimum value.
endSet the maximum value.
page upIncrements the value by a browser-defined larger step (approximately 10% of the range).
page downDecrements the value by a browser-defined larger step (approximately 10% of the range).
Theme Designer