Components
← All components

Input Mask

stimeo--input-mask

Formats a field against a fixed pattern, preserving the caret.

The stimeo--input-mask controller formats a field in place against a fixed pattern (9 = digit, a = letter, * = alphanumeric, anything else a literal): it inserts the separators as you type, rejects characters the token does not allow, and — crucially — keeps the caret in place on insert, Backspace, and range replacement. It separates the masked display from the raw value, syncing the unmasked digits to the hidden [data-stimeo--input-mask-unmask] field within the same form so the server receives the raw value. Tokens are configurable (your tokens merge over the defaults). It is idempotent — connect re-formats a server-rendered value — and holds no module-scope state, so it is stable across Turbo restore/morph. It reflects data-mask-complete / data-mask-empty and dispatches stimeo--input-mask:change. Currency Input owns money formatting; this is the generic mask. Behavior only.

running

Digits only; the parentheses, space, and dash are added for you.

Raw value sent to the server: (empty)