Categories
React Native Answers

How to add a text input with React Native?

Spread the love

To add a text input with React Native, we use the TextInput component.

For example, we write

<TextInput
  label={label}
  mode="outlined"
  theme={{
    colors: {
      primary: "#FFF",
    },
  }}
/>;

to add a TextInput with the label set to the label text.

The mode is outlined makes the text input show an outline.

And the colors.primary property set the main color of the text input.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *