Skip to main content
Version: 1.0.0

UserInput

UserInput components render a pre-styled input that can easily be re-style by using props.

Example banner Example banner

Implementation code

import { UserInput, Icon } from 'rn-nativeflow';
import { Phone } from 'lucide-react-native';


const Component = () => {
return (
<UserInput
variant='outlined'
label='Mobile'
placeholder='Enter your mobile number...'
helperText='Invalid mobile number'
isError={false}
renderLeftIcon={<Icon renderIcon={<Phone color="gray" size={17} />} />}
onChangeText={(e) => console.log(e)}
/>
);
}
export default Component;

Props

PropTypeDefaultDescription
variantoutlined, standardstandard
labelstringIt sets the label of input
bgstringtransparentSets background color of the UserInput
brnumber5Sets border radius of the UserInput
strokenumber1Sets Border width of the UserInput
strokeColorstringSets Border color of the UserInput
textColorstringSets text color of the UserInput
placeholderTextColorstringgraySets placeholder text color of the UserInput
fsnumber12Sets font size of the UserInput
labelFsnumber12Sets label font size of the UserInput
titleFFstringSets title font family of the button
cursorColorstringSets the cursor color of the UserInput
placeholderstringSets the placeholder of the UserInput
disabledbooleanIt disable the UserInput when it set to true
multilinebooleanEnable multiline text when it set to true
numberOfLinesnumberBy using this you can convert UserInput into text area and it works when multiline is set to true
isErrorbooleanIt sets the danger color on the text and border of the UserInput to indicate that the user has entered input
helperTextstringIt helps to show a small helper error message when user entered wrong input and it shows when isError sets to true
renderLeftIconJSX.ElementIt render a icon on the left side of UserInput
renderRightIconJSX.ElementIt render a icon on the right side of UserInput
containerStyleobjectHelps to change the styles of the main container
inputContStyleobjectHelps to change the styles of the input container
inputContStyleobjectHelps to change the styles of the input container
inputStyleobjectHelps to change the styles of the input field
labelStyleobjectHelps to change the styles of the input label