# Image Compare A before/after comparison on one layout-stable stage, driven by a native range input so it works with a mouse, a keyboard and a screen reader. ## Installation ```bash npx shadcn@latest add litingyes/blocove/image-compare ``` Both images share one stage, so the block never jumps while the two files load. The split is a native range input rather than a decorative handle: arrow keys move it, the value is announced, and the visual divider follows the same state. ## API Reference ### ImageCompare A before/after comparison on one layout-stable stage. The range input drives the split and stays visible for keyboard and screen-reader users. | Prop | Type | Default | | --- | --- | --- | | `before` | `ImageCompareSide` | `Required` | | `after` | `ImageCompareSide` | `Required` | | `beforeLabel` | `string` | `'Before'` | | `afterLabel` | `string` | `'After'` | | `defaultPosition` | `number` | `50` | | `aspectRatio` | `number | string` | `'16 / 9'` | | `widths` | `readonly number[]` | - | | `transform` | `(src, width) => string` | `Identity` | | `sizes` | `string` | - | | `rangeLabel` | `string` | `'Comparison position'` | | `className` | `string` | - | ### ImageCompareSide One side of the comparison. | Prop | Type | Default | | --- | --- | --- | | `src` | `string` | `Required` | | `alt` | `string` | `Required` | ## Registry dependencies - `litingyes/blocove/image` Namespace: `npx shadcn@latest add @blocove/image-compare`