Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-currency-masked-input
Advanced tools
Readme
<CurrencyInput />
Creates an input that gets masked as currency, in React.
Note: Dollar sign and styling not included
i.e.,
Entering a 1 shows: $0.01.
Entering 11 shows: $0.11.
Entering 110 shows: $1.10.
And so on.
Install via npm: npm install react-currency-masked-input
.
It accepts all properties you'd normally set on an input, so:
// your standard input
render() {
return <input name="myInput" placeholder="0" required />
}
Becomes a matter of simply replacing the tag to CurrencyInput
:
// with a currency mask
import CurrencyInput from 'react-currency-masked-input'
//...
render() {
return <CurrencyInput name="myInput" required />
}
Prop | Description | Values | Default |
---|---|---|---|
separator | The character use as a decimal point | . , , | . |
Usage notes:
type="number"
and pattern="\d*"
, but will override those props if you pass them in.defaultValue
prop passed in as an initial value, but will take over from there.props.value
is passed to it.onChange
prop after updating its internal value. First argument is the original event, the second is the masked value.myComponent.refs.input.value
, as you would with a normal ref.yarn
- install local dependencies
npm run bundle
- compiles source code to ./react-currency-masked-input.js
npm test
- Runs the unit tests in watch mode
npm run test:ci
- Runs the tests once; useful in CI.
FAQs
A currency input for React
The npm package react-currency-masked-input receives a total of 2,170 weekly downloads. As such, react-currency-masked-input popularity was classified as popular.
We found that react-currency-masked-input 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.