Overview
The Scratch to Reveal component creates an interactive scratch-off effect similar to lottery tickets. Users can scratch away the surface to reveal hidden content beneath with customizable completion thresholds and gradient colors.Usage
Props
The class name to apply to the component.
Width of the scratch container.
Height of the scratch container.
Minimum percentage of scratched area to be considered as completed (Value between 0 and 100).
Gradient colors for the scratch effect.
Events
Callback function called when scratch is completed.
Slots
default
The content to be revealed below the scratch-off ticket.
Credits
- Credits to Whbbit1999 for this component
- Inspired by MagicUI Scratch To Reveal