https://github.com/alkafinance/react-native-amount-input
⚛️ React Native JS-only amount (decimal) input component
https://github.com/alkafinance/react-native-amount-input
react-native react-native-component
Last synced: about 2 months ago
JSON representation
⚛️ React Native JS-only amount (decimal) input component
- Host: GitHub
- URL: https://github.com/alkafinance/react-native-amount-input
- Owner: alkafinance
- License: mit
- Created: 2019-07-30T18:25:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T08:16:00.000Z (over 2 years ago)
- Last Synced: 2025-04-22T21:48:46.471Z (2 months ago)
- Topics: react-native, react-native-component
- Language: TypeScript
- Homepage:
- Size: 3.22 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-amount-input
[](https://www.npmjs.org/package/react-native-amount-input)
[](https://circleci.com/gh/alkafinance/workflows/react-native-amount-input/tree/master)


[](https://github.com/prettier/prettier)
[](https://github.com/semantic-release/semantic-release)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.
```javascript
import {AmountInput} from 'react-native-amount-input';function MyComponent() {
return (
);
}
```## Props
- [Inherited `TextInput` props...](https://facebook.github.io/react-native/docs/textinput.html#props)
- [`currency`](#currency)
- [`defaultQuantity`](#defaultQuantity)
- [`onChangeQuantity`](#onChangeQuantity)
- [`TextInputComponent`](#TextInputComponent)---
# Reference
## Props
### `currency`
Sets the currency for a fixed symbol prefix in the text input box. Has to be a [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) 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](./LICENSE) © Alka, Inc