Skip to content

Commit b9318f3

Browse files
docs: updating docs
1 parent 99e58c0 commit b9318f3

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ The goal of `react-native-currency-input` is to offer a simple and effective way
1818
<img src="https://media.giphy.com/media/IUoA3IbKTtkRyq7R6U/giphy.gif" />
1919
</p>
2020

21+
- [Features](#features)
22+
- [Installation](#installation)
23+
- [Basic Usage](#basic-usage)
24+
- [Advanced Usage](#advanced-usage)
25+
- [Props](#props)
26+
- [Example](#example)
27+
- [FakeCurrencyInput](#fakecurrencyinput)
28+
- [FakeCurrencyInput *Usage*](#fakecurrencyinput-usage)
29+
- [FakeCurrencyInput *Props*](#fakecurrencyinput-props)
30+
- [`formatNumber`](#formatnumbervalue-options)
31+
- [`formatNumber` *Options*](#options-optional)
32+
2133
## Features
2234

2335
- A simple and practical component for number inputs
@@ -44,24 +56,38 @@ or
4456
yarn add react-native-currency-input
4557
```
4658

47-
## Usage
59+
## Basic Usage
4860

4961
```javascript
5062
import CurrencyInput from 'react-native-currency-input';
5163

5264
function MyComponent() {
5365
const [value, setValue] = React.useState(2310.458); // can also be null
5466

67+
return <CurrencyInput value={value} onChangeValue={setValue} />;
68+
}
69+
```
70+
71+
## Advanced Usage
72+
73+
```javascript
74+
import CurrencyInput from 'react-native-currency-input';
75+
76+
function MyComponent() {
77+
const [value, setValue] = React.useState(2310.458);
78+
5579
return (
5680
<CurrencyInput
5781
value={value}
5882
onChangeValue={setValue}
59-
prefix="$"
60-
delimiter=","
61-
separator="."
83+
prefix="R$"
84+
delimiter="."
85+
separator=","
6286
precision={2}
87+
minValue={0}
88+
showPositiveSign
6389
onChangeText={(formattedValue) => {
64-
console.log(formattedValue); // $2,310.46
90+
console.log(formattedValue); // R$ +2.310,46
6591
}}
6692
/>
6793
);

0 commit comments

Comments
 (0)