Skip to content

No.49 · Buttons

Stack Button

An add-to-bag button where the quantity is physical: every press slides another sheet out from behind it, and removing one peels the top sheet away.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Warm

Design an add-to-bag button whose quantity is shown as a physical stack rather than a badge. The button is a 52px-tall, 14px-radius slab (tone-coloured, inset top highlight) holding the label in Hanken 15px/600 and a small tabular count chip in the accent colour. Behind it, draw one 'sheet' per item: the same rounded shape inset 6px on each side, a subtle top-lit gradient, a 1px highlight and a short shadow. Sheet i sits (i+1)×5px higher than the button, is scaled down by 1.2% per level, and leans by a fixed, deterministic angle from a table (−1.3°, 0.9°, −0.5°, 1.4°…) around its bottom centre — so the stack always looks the same and reads as hand-stacked. The wrapper's top padding grows with the count (480ms expo-out) so the stack never overlaps what's above. Draw at most six sheets; the count keeps going. Pressing the button slides a new sheet up out from behind it (from translateY 0 and 0.96 width to its slot, 520ms cubic-bezier(0.16,1,0.3,1)) and rolls the digit up. Once the count is above zero, a minus segment slides open on the left (width 0 → 44px). Removing an item peels the top sheet off: it rises 26px, drifts right, rotates a further 7° and fades on an ease-in curve. Selected variant — Warm (ember): Warm tone (default): a warm near-black slab (#1b1714) with an amber count chip, "Add to bag" starting at 1, on #0c0b0a; caption "Stoneware cup · €24 each". This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Press to add one; the minus segment (appears once there's something to remove) peels the top sheet off. Motion: 520ms expo-out slide-up per sheet with a fixed lean table; 520ms ease-in peel; 380ms digit roll; minus segment width 420ms. Accessibility: Two real buttons (add, 'Remove one'); the count is announced politely ('3 in bag'); the stack is aria-hidden. Visible focus rings; reduced motion shows the stack without the slide/peel. Responsive behavior: Intrinsic width; the stack grows upward inside its own padding so nothing overlaps. Touch: Plain taps; press state nudges the label 1px. Tap highlight suppressed. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Press to add one; the minus segment (appears once there's something to remove) peels the top sheet off.
Motion
520ms expo-out slide-up per sheet with a fixed lean table; 520ms ease-in peel; 380ms digit roll; minus segment width 420ms.
Accessibility
Two real buttons (add, 'Remove one'); the count is announced politely ('3 in bag'); the stack is aria-hidden. Visible focus rings; reduced motion shows the stack without the slide/peel.
Responsive
Intrinsic width; the stack grows upward inside its own padding so nothing overlaps.
On touch
Plain taps; press state nudges the label 1px. Tap highlight suppressed.