Dates

Use type="date" with a format. Every part stays in its range and the day fits the month.

DD/MM/YYYY
YYYY-MM-DD
MM/DD/YYYY
MM/YY

Time

Hours stop at 23, minutes and seconds at 59. A digit that cannot start a part gets a 0 in front.

HH:mm
HH:mm:ss
DD/MM/YYYY HH:mm
YYYY-MM-DD HH:mm:ss

Phone numbers

A plain pattern: 0 is a digit and every other character is added for the user.

(000) 000-0000
+48 000 000 000
(00) 00000-0000
(00) 0000-0000

Payments

Groups of digits for card details, with ranges where a part has a limit.

0000 0000 0000 0000
MM/YY
000
aa00 0000 0000 0000 0000 0000 00

Postal codes and IDs

Use a for a letter and * for any character.

00000
00-000
**** ***
000-000-00-00
aa-0000

Network

Add ranges to keep every group of digits between a minimum and a maximum.

000.000.000.000, every part 0 to 255
000.000.000.000/00
Whole number, 0 to 65535

Numbers

Use type="number". Tabler groups the thousands and cuts the fraction to scale.

scale 0, thousands separated by a space
scale 3, comma as the radix
-10 000 to 10 000
min 0 removes the minus sign

Money

A prefix or suffix for the currency. padFractionalZeros completes the cents when the field loses focus.

$1,234.50
1 234,50 €
1.234,50 zł
¥1,234

Units

A number with a unit, and a max that the value never goes over.

0 to 100, one decimal place
Can be below zero
Three decimal places
Whole kilometres

Visible pattern

Add visible to show the whole pattern before the user types. Change the empty slot with placeholderChar.

The default
data-mask-placeholder-char="#"
Without visible, the field stays empty until the user types