
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-number-variants
Advanced tools
A multi-purpose React number component with variants for numbers, currencies, and percentages
A multi-purpose React number component with variants for numbers, currencies, and percentages
Features include:
https://react-number-variants.netlify.com/
https://github.com/MachineLlama/react-number-variants
https://www.npmjs.com/package/react-number-variants
npm install react-number-variants --save
or
yarn add react-number-variants
In your React component:
import Number from 'react-number-variants';
Simple example:
<Number
inputClassName="form-control"
minNumberOfDecimals={1}
maxNumberOfDecimals={3}
onEvent={(event, value) =>
this.setState({ event, value })
}
/>
Absolutely none; feel free to clone and use any part of this code anywhere you want
| Prop | Description | Type | Default |
|---|---|---|---|
| id | ID of the entire Number component container | string | 'react-number-variants' |
| inputId | ID of the input box | string | 'number-input' |
| className | ClassName of the entire Number component container | string | 'number-container' |
| inputClassName | ClassName of the input box | string | 'number-input' |
| value | The default starting value for the input | number | null |
| type | The type of number rendered; either 'number', 'percent', or 'currency' | string | 'number' |
| locale | The locale of the number rendered | string | 'en-US' |
| currency | If type is set to 'currency', then this prop will determine the symbol displayed | string | 'USD' |
| min | The minimum value the number can be | number | null |
| max | The maximum value the number can be | number | null |
| minNumberOfDecimals | Minimum number of decimal places allowed for value | number | 0 (can't be less than 0) |
| maxNumberOfDecimals | Maximum number of decimal places allowed for value | number | 20 (can't be greater than 20) |
| showError | Determines whether to show the error message or not | boolean | false |
| errorId | ID of the error message | string | 'error-message' |
| errorClassName | ClassName of the error message | string | 'error-message' |
| errorLocation | Location of the error message. Can be either 'top' or 'bottom', relative to the input box | string | 'bottom' |
| errorMessage | The error message displayed | string | 'error' |
| emitOnChange | Determines whether to emit an event message on-change (can be used for performance or validation purposes) | boolean | true |
| emitOnBlur | Determines whether to emit an event message on-blur | boolean | true |
| onEvent | Function that can be used to get the event name and value from the input. Can be used to drive external events in your React component (like with validation to show the error message) | function | null |
| disabled | Disable input | boolean | false |
| placeholder | Placeholder text | string | undefined |
FAQs
A multi-purpose React number component with variants for numbers, currencies, and percentages
The npm package react-number-variants receives a total of 2 weekly downloads. As such, react-number-variants popularity was classified as not popular.
We found that react-number-variants 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.