Skip to content

Commit 8327180

Browse files
committed
docs: add properties and methods documentation
1 parent 363b6b5 commit 8327180

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,40 @@ export function MyComponent() {
3939
}
4040
```
4141

42+
## Properties
43+
44+
| TextInputOTP | Type | Description |
45+
| ------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
46+
| `maxLength` | number - Required | The max number of digits to OTP code. |
47+
| `onFilled` | (code: string) => void - Optional | The callback function is executed when the OTP input has been entirely completed, and it receives the OTP code as a parameter. |
48+
49+
| TextInputOTPGroup | Type | Description |
50+
| ----------------- | -------------------- | ----------------------------- |
51+
| `groupStyles` | ViewStyle - Optional | Custom styles for the `View`. |
52+
53+
| TextInputOTPSlot | Type | Description |
54+
| ----------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------- |
55+
| `index` | number - Required | The position of the slot within the OTP input sequence. Each slot must have a unique index starting from 0. |
56+
| `slotStyles` | ViewStyle - Optional | Custom styles for the `View`. |
57+
| `focusedSlotStyles` | ViewStyle - Optional | Custom styles applied to the slot `View` when it is focused. |
58+
| `slotTextStyles` | TextStyle - Optional | Custom styles for the `Text`. |
59+
| `focusedSlotTextStyles` | TextStyle - Optional | Custom styles applied to the slot `Text` when it is focused. |
60+
61+
| TextInputOTPSeparator | Type | Description |
62+
| --------------------- | -------------------- | ----------------------------- |
63+
| `separatorStyles` | ViewStyle - Optional | Custom styles for the `View`. |
64+
65+
## Methods
66+
67+
The `TextInputOTP` component exposes these functions with `ref`:
68+
69+
| Prop | Type | Description |
70+
| ---------- | ------------------------ | -------------------------------------------------------------------------- |
71+
| `clear` | () => void; | Resets the OTP input by clearing all entered values. |
72+
| `focus` | () => void; | Activates the OTP input field, allowing the user to type. |
73+
| `blue` | () => void; | Deactivates the OTP input field, removing focus. |
74+
| `setValue` | (value: string) => void; | Sets a custom value to the OTP input fields, overriding any current input. |
75+
4276
## Contributing
4377

4478
Contributions are welcome! Please feel free to open issues or submit pull requests.

example/assets/adaptive-icon.png

-17.1 KB
Binary file not shown.

example/assets/favicon.png

-1.43 KB
Binary file not shown.

example/assets/icon.png

-21.9 KB
Binary file not shown.

example/assets/splash-icon.png

-17.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)