{"library":"react-input-mask","title":"Masked Input Component for React","description":"react-input-mask provides a simple and effective masked input component for React applications, allowing developers to enforce specific input formats such as phone numbers, dates, or social security numbers. The current stable version is 2.0.4, which was released approximately six years ago. The project appears to be in maintenance mode, with no significant updates since then. Its primary differentiator is its focused scope and direct integration into React workflows, offering a straightforward API for controlling input masking behavior and supporting dynamic mask changes. It's widely adopted for basic input masking requirements in React.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install react-input-mask"],"cli":null},"imports":["import InputMask from 'react-input-mask';","const InputMask = require('react-input-mask');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React, { useState } from 'react';\nimport InputMask from 'react-input-mask';\n\nfunction PhoneInput() {\n  const [phone, setPhone] = useState('');\n\n  const handleChange = (e) => {\n    setPhone(e.target.value);\n  };\n\n  return (\n    <div>\n      <label htmlFor=\"phone-number\">Phone Number:</label>\n      <InputMask\n        mask=\"+1 (999) 999-9999\"\n        value={phone}\n        onChange={handleChange}\n        maskChar=\"_\"\n        placeholder=\"+1 (___) ___-____\"\n        id=\"phone-number\"\n        className=\"form-input\"\n      >\n        {(inputProps) => <input {...inputProps} type=\"tel\" />}\n      </InputMask>\n      <p>Current Value: {phone}</p>\n    </div>\n  );\n}\n\nexport default PhoneInput;\n","lang":"typescript","description":"Demonstrates a basic phone number input with a mask, using a functional component with React hooks.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}