Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-number-textfield

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-number-textfield

Controlled ReactJS component for entering numbers.

  • 1.4.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ReactJS Number Textfield

ReactJS component for accepting numerical input as a standard textfield

Quickstart

Installation

npm install --save-dev react-number-textfield

Import

import { NumberTextfield } from "react-number-textfield"

Usage

<NumberTextfield
  decimal_character="."
  group_separator=","
  precision={ 2 }
  placeholder="Enter a number..."
  didChangeNumber={(newNumber) => {
    console.log("New Number", newNumber);
  }}
/>

Props

className string

CSS classes to apply to the input element.

placeholder string

Standard HTML placeholder attribute. This is the string displayed in the textfield when it is empty.

decimal_character string

Which character(s) should be used for the decimal point. Most commonly, this will be a comma or a dot.

group_separator string

Which character(s) should be used for grouping numbers every 3 digits. Most commonly, this will be a comma or a space.

precision number

Set the maximum number of decimal digits. Use 0 to disable decimals.

didChangeNumber function

Callback function that is executed every time the number value from the textfield changes. The function receives one argument: the number value from the textfield, or undefined if no number can be derived.

Keywords

FAQs

Package last updated on 02 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc