Skip to content

Compare ​

Before / after slider

Two images of the same frame — a retouch, a restoration, a colour grade — with a divider to drag between them. For two things side by side that aren't the same frame, lay them out next to each other instead.

Basic
Episode 1 key frame, flat colour
Episode 1 key frame, final grade
50% · drag or use ← →
Poster, red draft
Poster, orange final
  • It is a native range on top: drag anywhere, or focus it and use the arrow keys. The value is how much of #after shows, read out as "60% after".
  • orientation="vertical" splits top and bottom. In right-to-left pages the reveal starts from the right, with the range.
  • Give both images the same size and real alt text; label names the control.

Usage ​

ts
import { BlessCompare } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
labelstring"Compare"
orientation"horizontal" | "vertical""horizontal"
modelValuenumber500–100, how much of the "after" side is revealed

Events

NamePayloadDescription
update:modelValue[value: number]

Slots

NameScopeDescription
before—
after—

Released under the MIT License. Character names and artwork belong to their owners.