IMaskOptions
interface
Mask
Configuration object accepted by useMask and the OrigamTextField mask prop in its long form. Defines the pattern template, an optional secondary validator, and a required flag.
TypeScript
Definition
The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- patternrequiredstring
- Token-walker template string. # = digit, A = letter, * = any char, anything else is a literal preserved verbatim.
- validatorTPatternValidator | null
- Optional secondary check on the UNMASKED value (e.g. Luhn algorithm for credit cards).
- requiredboolean
- When true, isValid is false until every consumer token in the pattern is filled.
Ecosystem
Used by
Components and composables that extend or consume this interface.
Usage
Examples
Ready-to-paste code snippets using this interface.
Phone number mask with validation