A pure JavaScript masked text and input text component for React Native with built-in validators and raw value extraction.
react-native-masked-text is a React Native library that provides components for applying formatted masks to text inputs and static text. It simplifies data entry by enforcing specific formats like phone numbers, dates, and credit cards, improving user experience and data consistency. The library offers predefined masks for common formats and a custom mask builder for creating tailored patterns.
React Native developers building mobile applications that require formatted text inputs for data like phone numbers, identification numbers, dates, or financial information. It is particularly useful for developers targeting Brazilian users due to built-in support for CPF, CNPJ, and BRL phone formats.
Developers choose react-native-masked-text for its pure JavaScript, lightweight implementation without native dependencies, extensive customization options, and built-in validation methods. It stands out by offering both input masking for TextInput components and static text masking for Text components, along with a utility service for programmatic masking and validation.
A pure javascript masked text and input text component for React-Native.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes ready-to-use masks for CPF, CNPJ, and BRL phone numbers with automatic detection, saving development time for apps targeting Brazilian users.
Offers a custom mask builder with pattern syntax (e.g., AAA-9999) and configurable translations, allowing for tailored input formats beyond the defaults.
Provides .isValid() methods for masks like CPF, CNPJ, and datetime, enabling immediate data validation without additional logic, as documented in the README.
Exposes MaskService for programmatic masking, validation, and raw value extraction outside of components, adding versatility for complex use cases.
The README explicitly states the repo will not receive updates, making it risky for production use due to potential bugs, security issues, and lack of React Native compatibility updates.
While custom masks are available, the out-of-the-box predefined masks are skewed towards Brazilian formats, limiting utility for global applications without extra configuration.
Methods like getRawValue and isValid require accessing component refs, which can be cumbersome and less intuitive compared to modern React patterns like hooks or callbacks.