fn
maskCardOptions
v0.0.14A dynamic payment-card mask that groups digits by the detected
brand. The mask is a function of state: it reads the digits, resolves the brand
via findCardBrand (by IIN/BIN prefix), and applies that brand's grouping
template (e.g. #### ###### ##### for Amex) — falling back to a generic 16-digit
grouping until a brand is recognized. The unmasked value is the digit string.
Example
ts
const card = useMaskedInput({ mask: maskCardOptions() });
// <input v-bind="card.bind"> — 4111… → '4111 1111 1111 1111', 3714… → Amex 4-6-5Signature
ts
export function maskCardOptions(params: MaskCardParams ={ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
params? | MaskCardParams | Brands and fallback template |
Returns
MaskOptionsReady-to-use mask options (a function mask)| Property | Type | Description |
|---|---|---|
mask | Mask | The mask pattern (or a function of state). |
preprocessors? | readonly MaskPreprocessor[] | Normalizers run before conforming. |
postprocessors? | readonly MaskPostprocessor[] | Finishers run after conforming. |
overwriteMode? | OverwriteMode | Insert vs overwrite behavior. |