React Native Material ui Textinput Example

04-Apr-2023

.

Admin

React Native Material ui Textinput Example

Hi Guys,

In this blog, I will explain you how to create material ui textinput in react native. You can easily create material ui textinput in react native. First i will import TextInput namespace from react-native-paper, after I will make material ui textinput using in react native.

Here, I will give you full example for simply display material ui textinput using react native as bellow.

Step 1 - Create project


In the first step Run the following command for create project.

expo init MaterialUiTextinput

Step 2 - App.js

In this step, You will open App.js file and put the code.

import * as React from 'react';

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

const MyComponent = () => {

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

return (

<TextInput

label="Email"

value={text}

style= {{marginTop : 400,marginLeft : 20,marginRight : 20}}

onChangeText={text => setText(text)}

/>

);

};

export default MyComponent;

Step 3 - Run project

In the last step run your project using bellow command.

npm start

Output

It will help you...

#React Native