Skip to main content

TextInput

MNTextInput​

MNTextInput is a customizable and reusable input field component for React Native that supports labels, icons, and various input configurations like secure text, multiline input, and custom event handlers.


Import​

import MNTextInput from '@/components/ui/forms/MNTextInput';

Props​

PropTypeDefaultDescription
labelstringRequiredThe text label displayed above the input field.
valuestring''The current value of the input.
onChangeText(text: string) => voidRequiredCallback when the text value changes.
iconstringRequiredIonicon name for the icon displayed on the right.
autoCompletestring-Optional autoComplete value (e.g., email, username, etc.).
multipleLinesbooleanfalseWhether the input supports multiple lines.
editablebooleantrueWhether the input is editable.
secureTextbooleanfalseWhether the text should be obscured (e.g., for passwords).
iconClick() => void-Optional callback for when the icon is pressed.
onFocus() => void-Optional callback when the input is focused.
onBlur() => void-Optional callback when the input loses focus.

Usage Example​

<MNTextInput
label="Email"
value={email}
onChangeText={setEmail}
icon="mail-outline"
autoComplete="email"
secureText={false}
/>

MNTextInputAnimated​

A customizable and animated MNTextInput component with floating label support and optional icon interaction.


Import​

import MNTextInputAnimated from '@/components/MNTextInputAnimated';

Props​

PropTypeRequiredDefaultDescription
labelstring✅–Text to display as the floating label.
valuestring❌''Current value of the input field.
onChangeText(text: string) => void✅–Function called when the text changes.
iconstring✅–Name of Ionicon to display on the right side.
autoCompletestring❌-Optional autocomplete setting for input (e.g., email, username).
multipleLinesboolean❌falseWhether to allow multiline input.
editableboolean❌trueDetermines if the input can be edited.
secureTextboolean❌falseMasks the text input (for passwords).
iconClick() => void❌-Function triggered when the icon is pressed.
onFocus() => void❌-Callback fired on focus event.
onBlur() => void❌-Callback fired on blur event.

Usage Example​

<MNTextInputAnimated
label="Email"
value={email}
onChangeText={setEmail}
icon="mail-outline"
autoComplete="email"
secureText={false}
editable={true}
onFocus={() => console.log('Focused')}
onBlur={() => console.log('Blurred')}
iconClick={() => console.log('Icon clicked')}
/>

MNTextInputRounded​

A customizable and reusable rounded input field component with an optional icon and label, designed for React Native applications.


Import​

import MNTextInputRounded from '@/components/MNTextInputRounded';

Props​

Prop NameTypeRequiredDescription
labelstring✅ YesThe text label displayed above the input.
valuestring❌ NoThe current value of the input field.
onChangeText(text: string) => void✅ YesCallback function when the text is changed.
iconstring✅ YesIcon name from Ionicons to be displayed on the right side.
autoCompletestring❌ NoSpecifies autocomplete hints (e.g., email, name).
multipleLinesboolean❌ NoWhether to allow multiline input. Default is false.
editableboolean❌ NoIf false, disables editing. Default is true.
secureTextboolean❌ NoHides the input text (for passwords). Default is false.
iconClick() => void❌ NoCallback when the icon is clicked.
onFocus() => void❌ NoCallback when the input field receives focus.
onBlur() => void❌ NoCallback when the input field loses focus.

Usage Example​


<MNTextInputRounded
label="Email"
value={email}
onChangeText={setEmail}
icon="mail-outline"
autoComplete="email"
secureText={false}
iconClick={() => console.log('Icon clicked')}
/>

MNTextInputRounded​

A customizable and reusable rounded input field component with an optional icon and label, designed for React Native applications.


Import​

import MNTextInputRounded from '@/components/MNTextInputRounded';

Props​

Prop NameTypeRequiredDescription
labelstring✅ YesThe text label displayed above the input.
valuestring❌ NoThe current value of the input field.
onChangeText(text: string) => void✅ YesCallback function when the text is changed.
iconstring✅ YesIcon name from Ionicons to be displayed on the right side.
autoCompletestring❌ NoSpecifies autocomplete hints (e.g., email, name).
multipleLinesboolean❌ NoWhether to allow multiline input. Default is false.
editableboolean❌ NoIf false, disables editing. Default is true.
secureTextboolean❌ NoHides the input text (for passwords). Default is false.
iconClick() => void❌ NoCallback when the icon is clicked.
onFocus() => void❌ NoCallback when the input field receives focus.
onBlur() => void❌ NoCallback when the input field loses focus.

Usage Example​

<MNTextInputRounded
label="Email"
value={email}
onChangeText={setEmail}
icon="mail-outline"
autoComplete="email"
secureText={false}
iconClick={() => console.log('Icon clicked')}
/>

MNOneLineTextInputAnimated​

A customizable, animated single-line TextInput component for React Native, with support for floating labels, icons, and various input behaviors. Designed for use in mobile forms.


Import​

import MNOneLineTextInputAnimated from '@/components/ui/forms/textInputs/MNOneLineTextInputAnimated';

Props​

PropTypeRequiredDefaultDescription
labelstring✅—Label text shown above the input field.
valuestring❌''Input field value.
onChangeText(text: string) => void✅—Callback when input text changes.
iconstring✅—Icon name (Ionicons) displayed on the right.
autoCompletestring❌-HTML autocomplete value (ignored by TypeScript).
multipleLinesboolean❌falseAllows multi-line input.
editableboolean❌trueWhether the input is editable.
secureTextboolean❌falseMasks the text for secure entry (e.g., password).
iconClick() => void❌-Function called when the icon is pressed.
onFocus() => void❌-Function called when the input is focused.
onBlur() => void❌-Function called when the input loses focus.

Example Usage​

<MNOneLineTextInputAnimated
label="Email"
value={email}
onChangeText={setEmail}
icon="mail"
autoComplete="email"
secureText={false}
/>

---

> **NOTE:**
> All example can be founded in `input_fields.tsx`