Component packs › Lenticular › Lenticular Compare
Tilt the panel and last year's chart turns into this year's strip by strip, so you see exactly which bars moved.
Lenticular Compare is a before and after from Lenticular, a component pack with 6 lenticular controls: Cards, buttons and headings printed like lenticular plastic: tilt and the picture changes strip by strip. Price: $2 for the whole pack.
Built with: charts drawn from data, drag or tilt slider, strip sweep compare.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
first | string | a bar chart of `before` | First picture (HTML). Default: a bar chart of `before`. |
second | string | a bar chart of `after` | Second picture (HTML). Default: a bar chart of `after`. |
before | number[] | charts, one value per month | Data for the default charts, one value per month. |
after | number[] | ||
names | [string, string] | "2025", "2026" | Names of the two pictures. Default "2025", "2026". |
title | string | "Sign-ups per month" | What the numbers are. Default "Sign-ups per month". |
width | number | 340 | Width in px. Default 340. |
dark | boolean | ||
autoplay | number | false | Showcase mode: sways between the two (any number turns it on). |
tilt(t: number): void: -1 shows the first picture, 1 the second.destroy(): voidimport LenticularCompare from './LenticularCompare';
<LenticularCompare />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Skeuomorphic UI.