Finish Picker with Dimensions
What it does
A 2D finish selector: three buttons with split circular swatches swap the product cut-out inside a dimensioned box, the incoming PNG fading in from 0 to 1 while scaling 0.97 to 1 over 0.6s and the outgoing one fading out over 0.45s at the same time, so the box is never empty. Dashed SVG dimension lines (height on the left with a rotated label, diameter below) stretch with the box.
How it's built
| Category | interactive |
|---|---|
| Tech | gsap |
| Complexity | widget |
| Performance cost | light |
| Mobile-safe | yes |
Rebuild it with AI
This component's prompt is part of the paid library. Below you can read how it starts; the full prompt, the exact structure, timing and easing an AI agent needs to rebuild the effect, unlocks with any paid plan, yearly or lifetime.
# Finish Picker with Dimensions — swatches cross-fade a product inside a dimensioned box
## Goal
Build a 2D finish selector for one product sold in three finishes. On the left, a small panel titled "Finish" lists three buttons, each a split circular swatch plus the finish name; the chosen one is full opacity with a thin ring around its swatch, the others sit at half opacity. On the right, a light grey box holds the product as a transparent PNG, framed like a technical drawing: a dashed vertical dimension line with end ticks on the left, its label ("52 cm") rotated along it, and a dashed horizontal line below the box interrupted by "16 cm diameter". Clicking a finish cross-fades the product: the new cut-out fades in and grows from 0.97 to 1 while the old one fades out at the same time, so the box is never empty. White page, ink type, no accent.
## Tech
Vanilla HTML/CSS/JS, ES modules, `gsap` (npm) core only — no plugins. Fonts self-hosted: **Instrument Sans** (body, 400–700) and **IBM Plex Mono** (labels).
## Layout / HTML
```html
<main class="fpd">
<div class="fpd__selector" role="group" aria-label="Choose a finish">
<p class="fpd__sel-t">Finish</p>
<button class="fpd__op" type="button" aria-pressed="true" data-i="0"><span class="fpd__mu fpd__mu--niebla"></span>Mist and steel</button>
<button class="fpd__op" type="button" aria-pressed="false" data-i="1"><span class="fpd__mu fpd__mu--pizarra"></span>Slate and black steel</button>
…
Premium prompt
Unlock this prompt, and every other one
From $99/year, or $139 once for lifetime access. Commercial license included.
See pricing Or start with the free set Already bought? Sign in
New components in your inbox
One email a week, only when new components ship, each with its live demo and prompt.