React Native MantineInputs

TextInput

Single-line text input with validation

Import: import { TextInput } from 'react-native-mantine';

Usage

import { TextInput } from 'react-native-mantine';

// Basic TextInput
<TextInput
  label="Email"
  placeholder="your@email.com"
  value={email}
  onChangeText={setEmail}
/>

// With description and error
<TextInput
  label="Password"
  description="Must be at least 8 characters"
  placeholder="Enter password"
  secureTextEntry
  error={error}
  required
/>

// With icon and right section
<TextInput
  label="Search"
  placeholder="Type to search..."
  icon={<SearchIcon />}
  rightSection={<ClearButton />}
/>

Props

PropTypeDefaultDescription
labelReact.ReactNodeInput label displayed above the input field
descriptionReact.ReactNodeDescription text displayed below the label and above the input
errorReact.ReactNodeError message displayed below the input. When set, input border becomes red
size'xs' | 'sm' | 'md' | 'lg' | 'xl''sm'Input size that controls height, font size, and padding
radiusnumber | "xs" | "sm" | "md" | "lg" | "xl"'sm'Key of theme.radius or any valid number to set border-radius
iconReact.ReactNodeIcon displayed on the left side of the input field
rightSectionReact.ReactNodeContent displayed on the right side of the input (e.g., clear button, visibility toggle)
rightSectionWidthnumberWidth of the right section in pixels. If not set, defaults to input height
requiredbooleanfalseDisplays a red asterisk (*) after the label to indicate field is required
variant'default' | 'filled' | 'unstyled''default'Controls input appearance: default (outlined), filled (background), or unstyled (no borders)
styleViewStyleAdditional styles applied to the input element itself
wrapperStyleViewStyleAdditional styles applied to the wrapper container
placeholderstringPlaceholder text displayed when input is empty
valuestringInput value for controlled component
onChangeText(text: string) => voidCallback fired when input value changes
editablebooleantrueIf false, input is read-only and cannot be edited
multilinebooleanfalseIf true, input can contain multiple lines of text
secureTextEntrybooleanfalseIf true, text input obscures the entered text (for passwords)
autoCapitalize'none' | 'sentences' | 'words' | 'characters''sentences'Controls automatic capitalization behavior
keyboardTypeKeyboardTypeOptions'default'Determines which keyboard to open (e.g., numeric, email-address, phone-pad)

Source on GitHub · npm