Skip to main content

UserInput

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

Example banner Example banner

Implementation codeโ€‹

import { UserInput, Icon } from '@nexara/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
variant"outlined" | "standard""standard"Sets the style of the input border
labelstringโ€“Sets the label of the input
bgstringtheme.colors.inputBgColorBackground color of the input
brnumber10Border radius of the input
strokenumber1Border width of the input
strokeColorstringโ€“Border color of the input
labelColorstringโ€“Custom label color
textVariant{ label: string; helperText: string }{ label: 'h5', helperText: 'h6' }Text style variants for label and helper text
inputTextColorstringโ€“Text color for the input field
cursorColorstringโ€“Cursor color in the input
placeholderColorstringโ€“Placeholder text color
inputFsnumber13Font size of input text
labelFsnumberโ€“Font size of label text
helperTextFSnumberโ€“Font size of helper text
placeholderstring"Please enter..."Placeholder text for the input
disabledbooleanfalseDisables the input field
isErrorbooleanfalseMarks input as invalid (shows error styling)
helperTextstring""Error or helper message
multilinebooleanfalseEnables multiline input
renderLeftIconJSX.Elementโ€“Renders an icon to the left of the input
renderRightIconJSX.Elementโ€“Renders an icon to the right of the input
styles{ mainContainer?, label?, inputContainer?, input?, helperText? }โ€“Override styles for various sub-elements