react-native-money-amount-input
v0.2.0
Published
Money amount input for react native
Readme
react-native-money-amount-input
Money amount input for react native
Installation
npm install react-native-money-amount-inputor
yarn add react-native-money-amount-inputUsage
import { useRef } from 'react';
import { StyleSheet, View, KeyboardAvoidingView, Button } from 'react-native';
import MoneyAmountInput, {
type MoneyAmountInputRef,
} from 'react-native-money-amount-input';
export default function App() {
const inputRef = useRef<MoneyAmountInputRef>(null);
return (
<View style={styles.mainView}>
<MoneyAmountInput
ref={inputRef}
placeholder="-"
style={styles.exampleStyle}
onAmountChange={({ amount, formattedValue }) => {
console.log({ amount, formattedValue });
}}
/>
<View style={styles.buttonViews}>
<Button
title="Set Amount 20"
onPress={() => inputRef.current?.setAmount(20)}
/>
<Button title="Clear" onPress={() => inputRef.current?.clear()} />
<Button title="Focus" onPress={() => inputRef.current?.focus()} />
<Button title="Blur" onPress={() => inputRef.current?.blur()} />
</View>
</View>
);
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
