12
12
13
13
It implements the most common pattern of mobile form user interaction by convension over configuration. You'll never have to worry again about scrolling and focusing form fields.
14
14
15
- - It uses inline form fields with icons and titles
15
+ - It uses inline form fields with icons and labels
16
16
- It displays different icons for valid and invalid field values
17
17
- It displays validation message inside the field
18
18
- When a field receives focus, it displays a keyboard (\* )
@@ -82,10 +82,10 @@ class Form extends Component {
82
82
backgroundColor: ' lightgray' ,
83
83
}}>
84
84
< InlineTextInput
85
- title = ' Name'
85
+ label = ' Name'
86
86
placeholder= ' Tell us your name'
87
87
style= {{ borderColor: ' gray' }}
88
- titleStyle = {{ color: ' dimgray' }}
88
+ labelStyle = {{ color: ' dimgray' }}
89
89
inputStyle= {{ color: ' slategray' }}
90
90
messageStyle= {{ color: ' red' }}
91
91
icon= { < Icon name= {' account-circle' } size= {18 } color= {' steelblue' } / > }
@@ -97,13 +97,13 @@ class Form extends Component {
97
97
onChangeText= {(text ) => { this .setState ({name: text}) }}
98
98
/ >
99
99
< InlineTextInput
100
- title = ' Email'
100
+ label = ' Email'
101
101
102
102
autoCorrect= {false }
103
103
autoCapitalize= ' none'
104
104
keyboardType= ' email-address'
105
105
style= {{ borderColor: ' gray' }}
106
- titleStyle = {{ color: ' dimgray' }}
106
+ labelStyle = {{ color: ' dimgray' }}
107
107
inputStyle= {{ color: ' slategray' }}
108
108
messageStyle= {{ color: ' red' }}
109
109
icon= { < Icon name= {' mail-outline' } size= {18 } color= {' steelblue' } / > }
@@ -115,13 +115,13 @@ class Form extends Component {
115
115
onChangeText= {(text ) => { this .setState ({email: text}) }}
116
116
/ >
117
117
< InlineTextInput
118
- title = ' Password'
118
+ label = ' Password'
119
119
placeholder= ' Create a password'
120
120
autoCorrect= {false }
121
121
autoCapitalize= ' none'
122
122
secureTextEntry= {true }
123
123
style= {{ borderColor: ' gray' }}
124
- titleStyle = {{ color: ' dimgray' }}
124
+ labelStyle = {{ color: ' dimgray' }}
125
125
inputStyle= {{ color: ' slategray' }}
126
126
messageStyle= {{ color: ' red' }}
127
127
icon= { < Icon name= {' vpn-key' } size= {18 } color= {' steelblue' } / > }
@@ -164,7 +164,7 @@ class FormInput extends Component {
164
164
< InlineTextInput
165
165
ref= ' input' // This is necessary for focus() and blur() implementation to work
166
166
style= {{ borderColor: ' gray' }}
167
- titleStyle = {{ color: ' dimgray' }}
167
+ labelStyle = {{ color: ' dimgray' }}
168
168
inputStyle= {{ color: ' slategray' }}
169
169
messageStyle= {{ color: ' red' }}
170
170
icon= { < Icon name= {iconName} size= {18 } color= {' steelblue' } / > }
@@ -200,7 +200,7 @@ class Form extends Component {
200
200
return (
201
201
< StatelessForm style= {{flex: 1 , marginTop: 20 , backgroundColor: ' lightgray' }}>
202
202
< FormInput
203
- title = ' Name'
203
+ label = ' Name'
204
204
placeholder= ' Tell us your name'
205
205
iconName= ' account-circle'
206
206
value= {name}
@@ -209,7 +209,7 @@ class Form extends Component {
209
209
onChangeText= {(text ) => { this .setState ({name: text}) }}
210
210
/ >
211
211
< FormInput
212
- title = ' Email'
212
+ label = ' Email'
213
213
214
214
autoCorrect= {false }
215
215
autoCapitalize= ' none'
@@ -221,7 +221,7 @@ class Form extends Component {
221
221
onChangeText= {(text ) => { this .setState ({email: text}) }}
222
222
/ >
223
223
< FormInput
224
- title = ' Password'
224
+ label = ' Password'
225
225
placeholder= ' Create a password'
226
226
autoCorrect= {false }
227
227
autoCapitalize= ' none'
@@ -295,7 +295,7 @@ class FormInput extends Component {
295
295
< InlineTextInput
296
296
ref= ' input'
297
297
style= {{ borderColor: ' gray' }}
298
- titleStyle = {{ color: ' dimgray' }}
298
+ labelStyle = {{ color: ' dimgray' }}
299
299
inputStyle= {{ color: ' slategray' }}
300
300
messageStyle= {{ color: ' red' }}
301
301
icon= { < Icon name= {iconName} size= {18 } color= {' steelblue' } / > }
@@ -330,15 +330,15 @@ class Form extends Component {
330
330
< StatelessForm style= {{flex: 1 , marginTop: 20 , backgroundColor: ' lightgray' }}>
331
331
< FormInput
332
332
name= ' name'
333
- title = ' Name'
333
+ label = ' Name'
334
334
placeholder= ' Tell us your name'
335
335
iconName= ' account-circle'
336
336
value= {name}
337
337
onChangeText= {(text ) => { this .setState ({name: text}) }}
338
338
/ >
339
339
< FormInput
340
340
name= ' email'
341
- title = ' Email'
341
+ label = ' Email'
342
342
343
343
autoCorrect= {false }
344
344
autoCapitalize= ' none'
@@ -349,7 +349,7 @@ class Form extends Component {
349
349
/ >
350
350
< FormInput
351
351
name= ' password'
352
- title = ' Password'
352
+ label = ' Password'
353
353
placeholder= ' Create a password'
354
354
autoCorrect= {false }
355
355
autoCapitalize= ' none'
@@ -430,7 +430,7 @@ class FormInput extends Component {
430
430
< InlineTextInput
431
431
ref= ' input'
432
432
style= {{ borderColor: ' gray' }}
433
- titleStyle = {{ color: ' dimgray' }}
433
+ labelStyle = {{ color: ' dimgray' }}
434
434
inputStyle= {{ color: ' slategray' }}
435
435
messageStyle= {{ color: ' red' }}
436
436
icon= { < Icon name= {iconName} size= {18 } color= {' steelblue' } / > }
@@ -455,14 +455,14 @@ class Form extends Component {
455
455
< StatelessForm style= {{flex: 1 , marginTop: 20 , backgroundColor: ' lightgray' }}>
456
456
< FormInput
457
457
name= ' name'
458
- title = ' Name'
458
+ label = ' Name'
459
459
placeholder= ' Tell us your name'
460
460
iconName= ' account-circle'
461
461
{ ... name }
462
462
/ >
463
463
< FormInput
464
464
name= ' email'
465
- title = ' Email'
465
+ label = ' Email'
466
466
467
467
autoCorrect= {false }
468
468
autoCapitalize= ' none'
@@ -472,7 +472,7 @@ class Form extends Component {
472
472
/ >
473
473
< FormInput
474
474
name= ' password'
475
- title = ' Password'
475
+ label = ' Password'
476
476
placeholder= ' Create a password'
477
477
autoCorrect= {false }
478
478
autoCapitalize= ' none'
@@ -527,13 +527,13 @@ A wrapper that will manage auto-focusing and auto-scrolling for its children com
527
527
528
528
| Property | Type | Default | Description |
529
529
| ---------------| ----------| --------------| ----------------------------------------------------------------|
530
- | title | string | 'Use title prop' | Title for the text input |
530
+ | label | string | 'Use label prop' | Label for the text input |
531
531
| value | string | null | Value for the text input |
532
532
| valid | boolean | false | Whether the value is valid or not |
533
533
| message | string | null | Validation message to be shown |
534
534
| style | style | {} | Style changes to the main ScrollView |
535
535
| iconStyle | style | {} | Style changes to the icon View |
536
- | titleStyle | style | {} | Style changes to the title Text |
536
+ | labelStyle | style | {} | Style changes to the label Text |
537
537
| inputStyle | style | {} | Style changes to the TextInput |
538
538
| messageStyle | style | {} | Style changes to the validation message Text |
539
539
| icon | element | null | Any react component to be used as icon |
0 commit comments