TIN
Format tax IDs with a custom letter-based mask
TIN
The tin formatter applies a custom mask whose placeholders consume alphanumeric characters — designed for tax identifiers and reference numbers that mix letters and digits.
Options
| Option | Type | Default | Description |
|---|---|---|---|
mask | string | — | The mask, e.g. "XX-XXXXXXX". |
maskChar | string | "X" | The placeholder character that consumes alphanumeric input. |
Usage
validationSchema: {
tin: { format: { type: "tin", options: { mask: "XX-XXXXXXX", maskChar: "X" } } },
}Result
| Typed | Result |
|---|---|
AB1234567 | AB-1234567 |
Things to know
- Unlike
mask, everymaskCharoccurrence consumes letters and digits — usemaskwith#when only digits are allowed. - The dash (and any other non-
maskCharcharacters) are inserted automatically.