Put the prize and the foil inside ScratchCardSurface. The label names the foil.
reward-card.tsx
ScratchCard
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | |
| foil | "hatch""holographic""metallic" | — | The look of the foil: hatch (default, diagonal lines), metallic, or holographic. |
| threshold | number | — | The scratched share (0.2 to 1) past which the rest of the foil falls away. Default 0.6. |
| brush | number | — | The brush width in CSS px. Default 32. |
| revealed | boolean | — | The content shows (controlled). |
| default | boolean | — | The content shows at first (uncontrolled). |
| on | — | Called when the reveal starts (true) and after a reset (false). | |
| disabled | boolean | — | No scratch and no key reveal. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScratchCardSurface
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScratchCardContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScratchCardFoil
<button>| Prop | Type | Default | Description | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| driver | — | Drives a scratch from code (DragDriver, no item): a staged scene or a test presses the foil at a viewport point, carries the brush, and lets go. The cuts, the dust, and the reveal work as for a finger, and no pointer event is sent. | ||||||||||||
From Base UIButtonBase UI docs | ||||||||||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | |||||||||||
| class | — | CSS class applied to the element, or a function that returns a class based on the component's state. | ||||||||||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | ||||||||||||
| ||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | |||||||||||
ScratchCardLabel
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ScratchCardKeyHint
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
ScratchCardDescription
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
| Tab | Moves to the foil. The ScratchCardKeyHint shows under the label. |
|---|---|
| Enter | Plays a scratch sweep and shows the prize. The focus goes to the prize. |
| Space | Plays a scratch sweep and shows the prize. The focus goes to the prize. |











