react-native-amount-input
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

react-native-amount-input

npm package CircleCI Status Supports iOS MIT License code style: prettier

React Native JS-only amount (decimal) input component. Optimized for iOS.

Getting started

$ npm install react-native-amount-input --save

Usage

Import AmountInput and use it more or less like the regular TextInput component from React Native core.

import {AmountInput} from 'react-native-amount-input';
 
function MyComponent() {
  return (
    <View>
      <AmountInput
        currency="USD"
        defaultQuantity={defaultQuantity}
        onChangeQuantity={handleChangeQuantity}
      />
    </View>
  );
}

API

In addition to the regular TextInput props, you can also provide the following props for extra customization:

Props


Reference

Props

currency

Sets the currency for a fixed symbol prefix in the text input box. Has to be a ISO 4217 currency code.

Type Required
string No

defaultQuantity

Provides an initial value that will change when the user starts typing.

Type Required
number No

onChangeQuantity

Callback that is called when the entered quantity changes. Changed quantity is passed as a single string argument to the callback handler.

Type Required
number => void No

TextInputComponent

Sets the base text input component.

Type Required
typeof TextInput No

License

MIT License © Alka, Inc

Package Sidebar

Install

npm i react-native-amount-input

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

13.8 kB

Total Files

15

Last publish

Collaborators

  • alkabot