Skip to content

Commit 843c464

Browse files
committed
docs: update readme with onFilled prop
1 parent 19b6f36 commit 843c464

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

README.MD

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
- Supports OTP input with a fixed number of digits.
1515
- Highly customizable appearance and styling.
1616
- Supports autofill
17+
- Fully covered with unit tests.
1718
- Seamless integration with React Native and Expo applications.
19+
- Fully typed with TypeScript.
1820

1921
## Installation
2022

@@ -50,6 +52,7 @@ yarn add react-native-otp-entry
5052
focusColor="green"
5153
focusStickBlinkingDuration={500}
5254
onTextChange={(text) => console.log(text)}
55+
onFilled={(text) => console.log(`OTP is ${text}`)}
5356
theme={{
5457
containerStyle={styles.container},
5558
inputsContainerStyle={styles.inputsContainer},
@@ -64,14 +67,15 @@ yarn add react-native-otp-entry
6467

6568
The `react-native-otp-entry` component accepts the following props:
6669

67-
| Prop | Type | Description |
68-
| ---------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------- |
69-
| `numberOfDigits` | number | The number of digits to be displayed in the OTP entry. |
70-
| `focusColor` | ColorValue | The color of the input field border and stick when it is focused. |
71-
| `onTextChange` | (text: string) => void | A callback function that is invoked when the OTP text changes. It receives the updated text as an argument. |
72-
| `hideStick` | boolean | Hide cursor of the focused input. |
73-
| `theme` | Theme | Custom styles for each element. |
74-
| `focusStickBlinkingDuration` | number | The duration (in milliseconds) for the focus stick to blink. |
70+
| Prop | Type | Description |
71+
| ---------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
72+
| `numberOfDigits` | number | The number of digits to be displayed in the OTP entry. |
73+
| `focusColor` | ColorValue | The color of the input field border and stick when it is focused. |
74+
| `onTextChange` | (text: string) => void | A callback function is invoked when the OTP text changes. It receives the updated text as an argument. |
75+
| `onFilled` | (text: string) => void | A callback function is invoked when the OTP input is fully filled. It receives a full otp code as an argument. |
76+
| `hideStick` | boolean | Hide cursor of the focused input. |
77+
| `theme` | Theme | Custom styles for each element. |
78+
| `focusStickBlinkingDuration` | number | The duration (in milliseconds) for the focus stick to blink. |
7579

7680
| Theme | Type | Description |
7781
| ----------------------- | --------- | ---------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)