v0.1 public beta early access on GitHub
Home / Components / masked-input

Masked InputiOS

Text input with format masking — phone, card, currency, and custom '#' digit masks — returning raw and formatted values with label/helper/error/success states

$ npx lumioui add masked-input
import { applyMask, MaskedInput } from "@/components/ui/masked-input/masked-input";
Parts: applyMask
Masked Inputmasked-input.tsx
masked-input/masked-input.tsx open

Live preview — the real component, driven by the props below.

Props13
value? string Formatted value (controlled). Omit with `defaultValue` for uncontrolled.
defaultValue? string Initial formatted value (uncontrolled).
onChangeText? (raw: string, formatted: string) => void Called with (raw, formatted).
mask? string Custom mask — `#` marks a digit slot. Overrides `preset`.
preset? MaskPreset Built-in mask preset. Default "phone" when neither mask nor preset given.
currencySymbol? string Currency symbol prefix. Default "$".
label? string
helperText? string
error? string Error message — switches input to destructive styling.
success? boolean Shows an animated success check on the right edge (suppressed while `error` is set).
reserveHelperLine? boolean Reserve one helper line even when empty — prevents layout shift on error.
className? string
inputClassName? string
Masked Inputmasked-input.tsx
masked-input/masked-input.tsx open

Text input with format masking — phone, card, currency, and custom '#' digit masks — returning raw and formatted values with label/helper/error/success states