Build the mask once, outside the component. The raw number comes in the details of onValueChange.
send-amount.tsx
AutoScaleInput
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| mask | MaskPreset<Raw> | — | A number preset from #/lib/masks (currency, number, percent, unit). Build it once. |
| value | string | — | The shown value (controlled), formatted by the mask: "1250" shows "1,250". |
| default | string | — | The first shown value (uncontrolled), formatted by the mask. |
| on | — | Runs on every change with the shown value, the raw value, and the checks. | |
| max | number | 56 | The text size while the whole value fits, in px. Default 56. |
| min | number | 24 | The smallest text size, in px. Past it the field scrolls to the caret. Default 24. |
| align | "center""start" | "center" | Where the value sits in the field: center (default) or start. |
| reject | boolean | true | Nudge the value 2px when the mask rejects a key. Default true. |
| on | — | Runs when the mask rejects a key (a letter, a third decimal, a digit past max). | |
| raw | string | — | Also submit the raw value under this name (a hidden input), next to the shown one. |
| class | string | — | Classes of the root box (its width is the room the value fits in). |
| ref | Ref<HTMLInputElement> | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>. |











