New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@yaireo/react-number-input

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yaireo/react-number-input

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

converts input type number to locale string and back

React number-input component

Converts an <input type"number"> to a nicely-printed locale-based string when the input field has no focus, and when it receives focus, the input field reverts back to type number so it could be edited easily.

Supports currency transformation (AKA money) based on Number.prototype.toLocaleString.


Install

npm i @yaireo/react-number-input -s

Example usage (with currency)

import NumberInput from '@yaireo/react-number-input'

const MyComponent = () => (
  <NumberInput localeOptions={{
    maximumFractionDigits:2,
    currency:"USD",
    style:"currency",
    currencyDisplay:"symbol"
    }}
  />
)

Props

PropTypeDefaultInfo
placeholderstring
namestring
inputModestring"decimal"MDN docs
onChangefunction
defaultValuenumber""
localeOptionsObjectMDN docs

Keywords

color

FAQs

Package last updated on 03 Jul 2021

Did you know?

Socket

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.

Install

Related posts