
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-input-auto-format
Advanced tools
React Input Auto Format (catchy, I know) automatically formats the value of an input field while you're typing in it.
<Input format="## - ## - ##">

Install it:
npm install react-input-auto-format
Have fun:
import Input from 'react-input-auto-format';
function Foo () {
return <Input format="## - ## - ##" />;
}
The format prop accepts a pattern. The # character represents any number or letter, and you can put whatever else you like in there.
| Style | Pattern | Result |
|---|---|---|
| Expiry date | ## / ## | 12 / 34 |
| Sort code | ## - ## - ## | 12 - 34 - 56 |
| Number plate | #### ### | LM68 XKC |
To get the unformatted value, use the onValueChange prop.
function Foo () {
handleValueChange(value) {
console.log(value); // 123456
}
return <Input
format="## - ## - ##"
onValueChange={handleValueChange}
/>;
}
All other props work the same as you would expect for a native input component. If you want the formatted value, use a standard onChange attribute and pull out event.target.value.
FAQs
A super simple input component that formats as you type.
The npm package react-input-auto-format receives a total of 5 weekly downloads. As such, react-input-auto-format popularity was classified as not popular.
We found that react-input-auto-format demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.