Interface TextInputIOSProps

IOS Specific properties for TextInput

interface TextInputIOSProps {
    clearButtonMode?: "always" | "never" | "while-editing" | "unless-editing";
    clearTextOnFocus?: boolean;
    dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[];
    enablesReturnKeyAutomatically?: boolean;
    keyboardAppearance?: "light" | "default" | "dark";
    lineBreakStrategyIOS?: "none" | "standard" | "hangul-word" | "push-out";
    passwordRules?: null | string;
    rejectResponderTermination?: null | boolean;
    scrollEnabled?: boolean;
    selectionState?: DocumentSelectionState;
    smartInsertDelete?: boolean;
    spellCheck?: boolean;
    textContentType?: "none" | "username" | "password" | "newPassword" | "name" | "location" | "nickname" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "creditCardExpiration" | "creditCardExpirationMonth" | "creditCardExpirationYear" | "creditCardSecurityCode" | "creditCardType" | "creditCardName" | "creditCardGivenName" | "creditCardMiddleName" | "creditCardFamilyName" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "middleName" | "namePrefix" | "nameSuffix" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "oneTimeCode" | "birthdate" | "birthdateDay" | "birthdateMonth" | "birthdateYear";
}

Hierarchy (view full)

Properties

clearButtonMode?: "always" | "never" | "while-editing" | "unless-editing"

enum('never', 'while-editing', 'unless-editing', 'always') When the clear button should appear on the right side of the text view

clearTextOnFocus?: boolean

If true, clears the text field automatically when editing begins

dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[]

Determines the types of data converted to clickable URLs in the text input. Only valid if multiline={true} and editable={false}. By default no data types are detected.

You can provide one type or an array of many types.

Possible values for dataDetectorTypes are:

  • 'phoneNumber'
  • 'link'
  • 'address'
  • 'calendarEvent'
  • 'none'
  • 'all'
enablesReturnKeyAutomatically?: boolean

If true, the keyboard disables the return key when there is no text and automatically enables it when there is text. The default value is false.

keyboardAppearance?: "light" | "default" | "dark"

Determines the color of the keyboard.

lineBreakStrategyIOS?: "none" | "standard" | "hangul-word" | "push-out"

Set line break strategy on iOS.

passwordRules?: null | string

Provide rules for your password. For example, say you want to require a password with at least eight characters consisting of a mix of uppercase and lowercase letters, at least one number, and at most two consecutive characters. "required: upper; required: lower; required: digit; max-consecutive: 2; minlength: 8;"

rejectResponderTermination?: null | boolean

If true, allows TextInput to pass touch events to the parent component. This allows components to be swipeable from the TextInput on iOS, as is the case on Android by default. If false, TextInput always asks to handle the input (except when disabled).

scrollEnabled?: boolean

If false, scrolling of the text view will be disabled. The default value is true. Only works with multiline={true}

selectionState?: DocumentSelectionState

See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document

smartInsertDelete?: boolean

If false, the iOS system will not insert an extra space after a paste operation neither delete one or two spaces after a cut or delete operation.

The default value is true.

spellCheck?: boolean

If false, disables spell-check style (i.e. red underlines). The default value is inherited from autoCorrect

textContentType?: "none" | "username" | "password" | "newPassword" | "name" | "location" | "nickname" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "creditCardExpiration" | "creditCardExpirationMonth" | "creditCardExpirationYear" | "creditCardSecurityCode" | "creditCardType" | "creditCardName" | "creditCardGivenName" | "creditCardMiddleName" | "creditCardFamilyName" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "middleName" | "namePrefix" | "nameSuffix" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "oneTimeCode" | "birthdate" | "birthdateDay" | "birthdateMonth" | "birthdateYear"

Give the keyboard and the system information about the expected semantic meaning for the content that users enter.

To disable autofill, set textContentType to none.

Possible values for textContentType are:

  • 'none'
  • 'URL'
  • 'addressCity'
  • 'addressCityAndState'
  • 'addressState'
  • 'countryName'
  • 'creditCardNumber'
  • 'creditCardExpiration' (iOS 17+)
  • 'creditCardExpirationMonth' (iOS 17+)
  • 'creditCardExpirationYear' (iOS 17+)
  • 'creditCardSecurityCode' (iOS 17+)
  • 'creditCardType' (iOS 17+)
  • 'creditCardName' (iOS 17+)
  • 'creditCardGivenName' (iOS 17+)
  • 'creditCardMiddleName' (iOS 17+)
  • 'creditCardFamilyName' (iOS 17+)
  • 'emailAddress'
  • 'familyName'
  • 'fullStreetAddress'
  • 'givenName'
  • 'jobTitle'
  • 'location'
  • 'middleName'
  • 'name'
  • 'namePrefix'
  • 'nameSuffix'
  • 'nickname'
  • 'organizationName'
  • 'postalCode'
  • 'streetAddressLine1'
  • 'streetAddressLine2'
  • 'sublocality'
  • 'telephoneNumber'
  • 'username'
  • 'password'
  • 'newPassword'
  • 'oneTimeCode'
  • 'birthdate' (iOS 17+)
  • 'birthdateDay' (iOS 17+)
  • 'birthdateMonth' (iOS 17+)
  • 'birthdateYear' (iOS 17+)