Logo

TextInput.Icon

A component to render a leading / trailing icon in the TextInput

Usage

import * as React from 'react';
import { TextInput } from 'react-native-paper';

const MyComponent = () => {
  const [text, setText] = React.useState('');

  return (
    <TextInput
      label="Password"
      secureTextEntry
      right={<TextInput.Icon icon="eye" />}
    />
  );
};

export default MyComponent;

Props

icon (required)
Renamed from 'name' to 'icon` in v5.x

Icon to show.

Type: () => void

Function to execute on press.

Type: boolean
Default value: true

Whether the TextInput will focus after onPress.

Type: ((isTextInputFocused: boolean) => string | undefined) | string

Color of the icon or a function receiving a boolean indicating whether the TextInput is focused and returning the color.

Edit this page