Mask Input
A text input that enforces a format mask as the user types, with tokens 9 for digit, A for letter, and * for alphanumeric, and auto-insertion of literal characters.
Preview
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
mask | string | — | Format mask string (9=digit, A=letter, *=alphanumeric, other chars are literals) |
placeholder | string | — | Input placeholder text |
value | string | — | Current masked value |
disabled | boolean | — | Disable the input |
Installation
pura is copy-paste and dependency-free. Load the whole library, or just this component.
<link rel="stylesheet" href="/pura/tokens.css">
<script type="module" src="/pura/lib/mask-input.js"></script> import "./pura/lib/mask-input.js";