Shadcn Mask Input Components

An input that formats what people type into phone numbers, dates, times, credit cards, currency, percentages, IP addresses, and custom patterns, with caret aware editing, paste support, validation modes, and form integration. Built on ui-sdk and styled with shadcn/ui theme tokens. Browse our collection of 8 Shadcn Mask Input variants.

Phone number

Masked: None · Raw: None

Built-in patterns

phone

ssn

date

time

creditCard

creditCardExpiry

zipCode

zipCodeExtended

currency

percentage

licensePlate

ipv4

macAddress

isbn

ein

Currency and locale

en-US · 1234.56

de-DE · 2499.9

ja-JP · 150000

en-GB · 89.5

Custom patterns

Letters are converted to uppercase.

Fixed prefix with grouped digits.

Custom format function with a prefix.

Validation modes

onChange

Validates on every keystroke.

onBlur

Validates when the field loses focus.

onTouched

Validates on first blur, then on every change.

onSubmit

Validates when the form is submitted, then on change.

all

Validates on both change and blur.

Card information

Payment details
Your card is charged when the trial ends.
Checkout form

With react-hook-form

Account form

With addons

+1
UTC
Unlock premium components
Get full control of shadcn/ui components, blocks and instances, including future additions.

Explore Shadcn Blocks

Ready-made page sections built with the same components.

View all blocks