Component packs › Parcel › Scratch Promo

Scratch Promo

Scratch the foil off with flakes flying; past half it peels away, and applying the code drops the discount into a total that rolls down.

Scratch Promo is a promo code from Parcel, a component pack with 8 components: E-commerce components where every product turns, packs and travels. Price: $2 for the whole pack.

Built with: scratch canvas, reveal button, discount drop.

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.

Scratch Promo props

PropTypeDefaultDescription
codestringThe code under the foil.
offnumberDiscount as a fraction (0.2 = 20 %).
subtotalnumberOrder subtotal.
currencystring
onApply(code: string, total: number) => void
theme'dark' | 'light'
autoplaybooleanShowcase mode: scratches, applies and resets until touched.

Methods on the ref

Use it in React

import ScratchPromo from './ScratchPromo';

<ScratchPromo />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Parcel

Good for: E-commerce UI components.