2020## TODO
2121
2222- [ ] Fix defaultProp issue with picker library
23- - [ ] Make similar UI with OTP lib
24- - [ ] Add Error state
25- - [ ] Make fully customizable
23+ - [ ] Add custom country picker modal
2624
2725## Installation
2826
@@ -69,15 +67,15 @@ export default function App() {
6967 callingCode: ' +1' ,
7068 phoneNumber: ' ' ,
7169 }}
72- withShadow
73- withDarkTheme
70+ theme= {{
71+ withShadow: true ,
72+ withDarkTheme: true ,
73+ containerStyle: styles .phoneContainer ,
74+ textInputStyle: styles .input ,
75+ flagButtonStyle: styles .flagButton ,
76+ }}
7477 autoFocus
7578 placeholder= " Enter phone number"
76- containerStyle= {styles .phoneContainer }
77- textContainerStyle= {styles .textInput }
78- textInputStyle= {styles .input }
79- flagButtonStyle= {styles .flagButton }
80- countryPickerButtonStyle= {styles .countryPicker }
8179 layout= " second"
8280 onChangeText= {(text ) => console .log (' Phone number:' , text)}
8381 onChangeCountry= {(country ) => console .log (' Country:' , country)}
@@ -86,26 +84,31 @@ export default function App() {
8684
8785## Props
8886
89- | Prop | Type | Description |
90- | -------------------------- | ---------------------------- | --------------------------------------------------------------- |
91- | ` defaultValues ` | ` object ` | Default values for country code, calling code, and phone number |
92- | ` value ` | ` string ` | Controlled value for the phone number input |
93- | ` onChangeText ` | ` (text: string) => void ` | Callback when phone number changes |
94- | ` onChangeCountry ` | ` (country: Country) => void ` | Callback when selected country changes |
95- | ` withShadow ` | ` boolean ` | Adds shadow to the input container |
96- | ` withDarkTheme ` | ` boolean ` | Enables dark theme |
97- | ` autoFocus ` | ` boolean ` | Automatically focuses the input when mounted |
98- | ` placeholder ` | ` string ` | Placeholder text for the phone number input |
99- | ` disabled ` | ` boolean ` | Disables the input |
100- | ` layout ` | ` 'first' \| 'second' ` | Layout style for the country picker and input |
101- | ` containerStyle ` | ` StyleProp<ViewStyle> ` | Style for the main container |
102- | ` textContainerStyle ` | ` StyleProp<ViewStyle> ` | Style for the text input container |
103- | ` textInputStyle ` | ` StyleProp<TextStyle> ` | Style for the text input |
104- | ` flagButtonStyle ` | ` StyleProp<ViewStyle> ` | Style for the flag button |
105- | ` countryPickerButtonStyle ` | ` StyleProp<ViewStyle> ` | Style for the country picker button |
106- | ` countryPickerProps ` | ` CountryPickerProps ` | Props for the country picker modal |
107- | ` filterProps ` | ` object ` | Props for the country filter |
108- | ` maskInputProps ` | ` MaskInputProps ` | Props for the masked input component |
87+ | Prop | Type | Description |
88+ | -------------------- | ---------------------------- | --------------------------------------------------------------- |
89+ | ` defaultValues ` | ` object ` | Default values for country code, calling code, and phone number |
90+ | ` value ` | ` string ` | Controlled value for the phone number input |
91+ | ` onChangeText ` | ` (text: string) => void ` | Callback when phone number changes |
92+ | ` onChangeCountry ` | ` (country: Country) => void ` | Callback when selected country changes |
93+ | ` autoFocus ` | ` boolean ` | Automatically focuses the input when mounted |
94+ | ` placeholder ` | ` string ` | Placeholder text for the phone number input |
95+ | ` disabled ` | ` boolean ` | Disables the input |
96+ | ` layout ` | ` 'first' \| 'second' ` | Layout style for the country picker and input |
97+ | ` countryPickerProps ` | ` CountryPickerProps ` | Props for the country picker modal |
98+ | ` filterProps ` | ` object ` | Props for the country filter |
99+ | ` maskInputProps ` | ` MaskInputProps ` | Props for the masked input component |
100+ | ` theme ` | ` Theme ` | Theme configuration for styling the component |
101+
102+ ### Theme Properties
103+
104+ | Property | Type | Description |
105+ | ----------------- | ---------------------- | ------------------------------------ |
106+ | ` containerStyle ` | ` StyleProp<ViewStyle> ` | Style for the main container |
107+ | ` textInputStyle ` | ` StyleProp<TextStyle> ` | Style for the text input |
108+ | ` codeTextStyle ` | ` StyleProp<TextStyle> ` | Style for the calling code text |
109+ | ` flagButtonStyle ` | ` StyleProp<ViewStyle> ` | Style for the flag button |
110+ | ` withDarkTheme ` | ` boolean ` | Enables dark theme for the component |
111+ | ` withShadow ` | ` boolean ` | Adds shadow to the input container |
109112
110113## Contributing
111114
0 commit comments