Gathering detailed insights and metrics for react-native-material-textfield-new
Gathering detailed insights and metrics for react-native-material-textfield-new
Gathering detailed insights and metrics for react-native-material-textfield-new
Gathering detailed insights and metrics for react-native-material-textfield-new
npm install react-native-material-textfield-new
Typescript
Module System
Node Version
NPM Version
42.4
Supply Chain
57.6
Quality
66.4
Maintenance
50
Vulnerability
93.6
License
JavaScript (58.96%)
Java (17.45%)
C++ (6.98%)
Objective-C (6.27%)
Objective-C++ (4.26%)
Ruby (4.2%)
Starlark (1.15%)
Shell (0.46%)
CMake (0.26%)
Total Downloads
8,059
Last Day
49
Last Week
256
Last Month
1,190
Last Year
5,022
1 Stars
351 Commits
2 Forks
1 Watching
1 Branches
1 Contributors
Latest Version
0.17.5
Package Id
react-native-material-textfield-new@0.17.5
Unpacked Size
191.69 kB
Size
18.67 kB
File Count
41
NPM Version
6.14.15
Node Version
14.18.2
Cumulative downloads
Total Downloads
Last day
63.3%
49
Compared to previous day
Last week
0.4%
256
Compared to previous week
Last month
53.9%
1,190
Compared to previous month
Last year
117.8%
5,022
Compared to previous year
1
2
Material texfield with consistent behaviour on iOS and Android.
This package is a cloned version of react-native-material-textfield. I've added few fixes to the package.
1npm install --save react-native-material-textfield-new
or
1yarn add react-native-material-textfield-new
1import React, { Component } from 'react'; 2import { 3 TextField, 4 FilledTextField, 5 OutlinedTextField, 6} from 'react-native-material-textfield-new'; 7 8class Example extends Component { 9 fieldRef = React.createRef(); 10 11 onSubmit = () => { 12 let { current: field } = this.fieldRef; 13 14 console.log(field.value()); 15 }; 16 17 formatText = (text) => { 18 return text.replace(/[^+\d]/g, ''); 19 }; 20 21 render() { 22 return ( 23 <OutlinedTextField 24 label='Phone number' 25 keyboardType='phone-pad' 26 formatText={this.formatText} 27 onSubmitEditing={this.onSubmit} 28 ref={this.fieldRef} 29 /> 30 ); 31 } 32}
name | description | type | default |
---|---|---|---|
textColor | Text input color | String | rgba(0, 0, 0, .87) |
fontSize | Text input font size | Number | 16 |
labelFontSize | Text field label font size | Number | 12 |
lineWidth | Text field underline width | Number | 0.5 |
activeLineWidth | Text field active underline width | Number | 2 |
disabledLineWidth | Text field disabled underline width | Number | 1 |
tintColor | Text field accent color | String | rgb(0, 145, 234) |
baseColor | Text field base color | String | rgba(0, 0, 0, .38) |
label | Text field label text | String | - |
title | Text field helper text | String | - |
prefix | Text field prefix text | String | - |
suffix | Text field suffix text | String | - |
error | Text field error text | String | - |
errorColor | Text field color for errored state | String | rgb(213, 0, 0) |
errorTestId | Text field error testID | String | - |
lineType | Text field line type | String | solid |
disabledLineType | Text field line type in disabled state | String | dotted |
animationDuration | Text field animation duration in ms | Number | 225 |
characterRestriction | Text field soft limit for character counter | Number | - |
disabled | Text field availability | Boolean | false |
editable | Text field text can be edited | Boolean | true |
multiline | Text filed multiline input | Boolean | false |
contentInset | Layout configuration object | Object | {...} |
labelOffset | Label position adjustment | Object | {...} |
inputContainerStyle | Style for input container view | Object | - |
containerStyle | Style for container view | Object | - |
labelTextStyle | Style for label inner Text component | Object | - |
titleTextStyle | Style for title inner Text component | Object | - |
affixTextStyle | Style for affix inner Text component | Object | - |
formatText | Input mask callback | Function | - |
renderLeftAccessory | Render left input accessory view | Function | - |
renderRightAccessory | Render right input accessory view | Function | - |
onChangeText | Change text callback | Function | - |
onFocus | Focus callback | Function | - |
onBlur | Blur callback | Function | - |
Other TextInput properties will also work.
name | description | Normal | Filled | Outlined |
---|---|---|---|---|
top | Inset on the top side | 16 | 8 | 0 |
left | Inset on the left side | 0 | 12 | 12 |
right | Inset on the right side | 0 | 12 | 12 |
label | Space between label and TextInput | 4 | 4 | 4 |
input | Space between line and TextInput | 8 | 8 | 16 |
name | description | Normal | Filled | Outlined |
---|---|---|---|---|
x0 | Horizontal offset for inactive state | 0 | 0 | 0 |
y0 | Vertical offset for inactive state | 0 | -10 | 0 |
x1 | Horizontal offset for active state | 0 | 0 | 0 |
y1 | Vertical offset for active state | 0 | -2 | -10 |
name | description | returns |
---|---|---|
focus() | Acquire focus | - |
blur() | Release focus | - |
clear() | Clear text field | - |
value() | Get current value | String |
isFocused() | Get current focus state | Boolean |
isErrored() | Get current error state | Boolean |
isRestricted() | Get current restriction state | Boolean |
isDefaultVisible() | Get default value visibility | Boolean |
isPlaceholderVisible() | Get placeholder visibility | Boolean |
setValue() | Set current value | - |
We are using Yalc to manage local dependency for development.
1git clone https://github.com/sriram10/react-native-material-textfield-new 2 3cd react-native-material-textfield-new 4yarn 5npx yarn publish 6cd exampleApp 7npx yalc add react-native-material-textfield-new 8yarn 9yarn ios # or yarn android
BSD License Copyright 2022 Sriram. All rights reserved.
Thanks to Alexander Nazarov for creating this awesome library.
No vulnerabilities found.
No security vulnerabilities found.