Custom text input in react native | Web Scripts | Crax

Welcome To Crax.Pro Forum!

Check our new Marketplace at Crax.Shop

   Login! SignUp Now!
  • We are in solidarity with our brothers and sisters in Palestine. Free Palestine. To learn more visit this Page

  • Crax.Pro domain has been taken down!

    Alternatives: Craxpro.io | Craxpro.com

Custom text input in react native

Custom text input in react native

LV
0
 

tempcp001

Member
Joined
Jan 7, 2024
Threads
12
Likes
0
Awards
2
Credits
1,206©
Cash
0$
import React from 'react';
import { View, Text, TextInput, StyleSheet } from 'react-native';
const CustomInput = ({ label, placeholder, value, onChangeText, ...otherProps }) => (
<View style={styles.container}>
{label && <Text style={styles.label}>{label}</Text>}
<TextInput
style={styles.input}
placeholder={placeholder}
value={value}
onChangeText={onChangeText}
{...otherProps}
/>
</View>
);
const styles = StyleSheet.create({
container: {
width: '100%',
marginBottom: 15,
},
label: {
fontSize: 14,
marginBottom: 5,
},
input: {
height: 40,
borderColor: 'gray',
borderWidth: 1,
borderRadius: 5,
paddingLeft: 10,
paddingRight: 10,
},
});
export default CustomInput;
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top Bottom