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"Defines the border style of the input field.
labelstringLabel text displayed above the input.
bgstringtheme.colors.inputBgColorBackground color of the input field.
brnumber10Border radius of the input field.
strokenumber1Border width of the input field.
strokeColorstringBorder color of the input field.
labelColorstringCustom color for the label text.
textVariant{ label: string; helperText: string }{ label: 'h5', helperText: 'h6' }Typography variants for label and helper text.
inputTextColorstringText color inside the input field.
cursorColorstringCursor color in the input field.
placeholderColorstringColor of the placeholder text.
inputFsnumber13Font size of the input text.
labelFsnumberFont size of the label text.
helperTextFSnumberFont size of the helper/error text.
placeholderstring"Please enter..."Placeholder text shown when input is empty.
disabledbooleanfalseDisables the input field when true.
isErrorbooleanfalseMarks the input as invalid (applies error styles).
helperTextstring""Message shown below the input (error/help).
multilinebooleanfalseEnables multiline input support.
renderLeftIconJSX.ElementRenders a custom icon on the left side.
renderRightIconJSX.ElementRenders a custom icon on the right side.
styles{ mainContainer?, label?, inputContainer?, input?, helperText? }Custom styles for different sub-elements.