Skip to content

Scratch Card

<bh-scratch-card> | BharatScratchCard

The Scratch Card component creates an interactive element that reveals hidden content when scratched, similar to a lottery scratch card. It’s perfect for promotions, rewards, games, and interactive experiences.

Open in flex-shrink: 0; flex-shrink: 0;

Exclusive Component

🎉 Special Thanks To

Bharat UIbharatui.com

Free Gift!

Redeem your special gift

Basic Scratch Card

A simple scratch card with default settings that reveals text when scratched.

Custom Overlay Color

Change the color of the scratch surface to match your design.

Promotional Card

A more complex example showing how to use the scratch card for promotions.

Open in flex-shrink: 0; flex-shrink: 0;

Scratch to reveal your discount!

25% OFFUse code: BHARAT25

Valid until December 31, 2025

Image Reveal

Reveal an image when the card is scratched.

Discount Offer Variant

Reveal an image when the card is scratched.

Open in flex-shrink: 0; flex-shrink: 0;

Limited Time Offer

Special Thanks To

Properties

PropertyTypeDescription
widthstringWidth of the scratch card (e.g. 300px)
heightstringHeight of the scratch card (e.g. 200px)
scratch-colorstringScratch layer color (e.g. #e11d48)
background-colorstringBackground behind the scratch layer
border-radiusstringRounded corners of the card (default: 12px)
reveal-textstringText shown after reveal, if no custom content is slotted
reveal-percentagenumberPercentage (0-100) of area to scratch before revealing
confettibooleanEnables confetti animation on reveal
card-idstringUnique ID to persist scratch state using localStorage
expiry-daysnumberNumber of days before the scratch card expires
already-revealedbooleanIf true, the card starts already revealed
is-expiredbooleanIf true, the card will render as expired (overrides expiry-days)
reward-typestringType of reward (e.g. “discount”, “gift”, “cashback”)
coupon-codestringOptional coupon code displayed on reveal with a copy button
overlay-colorstringAlias for scratch-color (if preferred)
scratch-widthnumberWidth of the brush when scratching (default: 40)
auto-revealbooleanAutomatically reveal once reveal-percentage is reached