1.0.5 • Published 5 years ago
react-native-toggle-password-visibility v1.0.5
React Native Toggle Password Visibility
This is a custom component for React Native, a simple Toggle Password InputText, compatible with both ios, android and expo.
for expo use react-native-toggle-password-visibility-expo
Installation.
Install the package with YARN.
yarn add react-native-toggle-password-visibility --save
Or with NPM
npm install react-native-toggle-password-visibility --save
How to use.
Very simple to use just add this component in your file.
// import packages
import React, {useState} from 'react';
import { View } from 'react-native';
import InputPasswordToggle from 'react-native-toggle-password-visibility';
export default function App() {
const [password, setPassword] = useState('');
return (
<InputPasswordToggle
value={password}
onChangeText={setPassword}/>
);
}
Props
name | description | type | default |
---|---|---|---|
icon | Icon before input | Number | none |
iconSize | Eye icon size | Number | 20 |
iconColor | Eye icon color | String | #222222 |
inputStyle | Style Input | object | null |
// Icon before input
<InputPasswordToggle
icon="lock"
value={password}
onChangeText={setPassword}/>
);
}