
Description
@mona-health/react-input-mask is a masked input component for React. It is a fork of the react-input-mask project and is made with attention to UX. You give it a mask, and it formats what the user types to fit that pattern. Simple masks are strings in which 9 accepts digits, a accepts letters and * accepts digits or letters, and any format character can be escaped with a backslash. More complex masks can be arrays of regular expressions and constant characters. The maskPlaceholder prop sets the character that covers unfilled parts of the mask, which defaults to an underscore, and setting it to null or an empty string leaves those parts empty. alwaysShowMask keeps the mask prefix and placeholder visible when the input is empty and not focused. beforeMaskedStateChange lets you change the value and selection before the mask is applied. The children prop takes a custom render element, so the mask can work with other input components. The README says react-input-mask v3 requires React 16.8.0 or later, and that older React versions should use version 2.…
Highlights
- Masked input for React with string or array masks
- Placeholder and always-show options
- beforeMaskedStateChange hook for custom value handling
- Custom render child for other input components
- Requires React 16.8 or later for v3
Ratings & Reviews
No ratings yet
Be the first to rate @mona-health/react-input-mask.
People also visit
@mona-health/react-input-mask FAQ
What does it do?
It is a masked input component for React. It formats what a user types so the value fits a pattern you define.
How do I define a mask?
Use a string where 9 is a digit, a is a letter and * is a digit or letter. For more complex masks, use an array of regular expressions and constant characters.
What React version do I need?
v3 needs React 16.8.0 or later. The README says to use version 2 for older React versions.
Can I use it with my own input component?
Yes. Pass a child element as a custom render function, which the README says allows integration with other input components.
What placeholder does it show?
An underscore by default, set with maskPlaceholder. Set it to null or an empty string to leave the unfilled parts empty.
What are the best @mona-health/react-input-mask alternatives?
Popular alternatives to @mona-health/react-input-mask include react-input-mask, @react-input/mask and react-maskedinput. See all @mona-health/react-input-mask alternatives


















