Forms

MaskedInput

Format codes and other identifiers as users type with a configurable mask.

Basic usage

The # character accepts one digit and the hyphen is literal. Pass the initial sequence without the hyphen. submitValue="raw" submits only the digits.

Enter six digits. The hyphen is inserted automatically.

API

Key props and defaults.

PropValues and behaviorDefault
maskstring | readonly string[]required
tokensInputMaskTokensbuilt-in tokens
value / defaultValueraw stringempty
onValueChange(details) => void—
submitValueformatted | rawformatted