😎
安装
用法
import { ScratchToReveal } from "@/components/magicui/scratch-to-reveal";
<ScratchToReveal width={300} height={300} minScratchPercentage={50}>
Scratch To Reveal
</ScratchToReveal>
属性
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
className | string | - | 应用于组件的类名。 |
width | number | - | 刮刮乐容器的宽度。 |
height | number | - | 刮刮乐容器的高度。 |
minScratchPercentage | number | 50 | 被视为完成的刮开区域的最小百分比(值介于0到100之间)。 |
children | 节点 | - | 要在跑马灯中显示的内容。 |
onComplete | 函数 | - | 刮开完成后调用的回调函数 |
gradientColors | string[] | - | 刮刮乐效果的渐变颜色。 |