ReactJS Evergreen TextInput Component Last Updated : 11 Jun, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. TextInput Component allows the user to type the input text through a text input field. We can use the following approach in ReactJS to use the Evergreen TextInput Component. TextInput Props: required: The input element is required when this is set to true.disabled: The input element disabled when this is set to true.isInvalid: It is used to set the visual styling of _only_ the text input to be invalid.spellCheck: It is used for the native spell check functionality of the browser.placeholder: It is used to denote the placeholder text.appearance: It is used for the appearance of the TextInput.width: It is used to denote the width of the TextInput.className: It is used to pass the class name to the button. TextInputField Props: label: It is used to denote the label used above the input element.labelFor: It is used to denote the passed on the label as a htmlFor prop.required: It is used to indicate whether to show an asterix after the label or not.description: Defines optional description of the field which is under the label and above the input element.hint: It is used to define an optional hint under the input element.validationMessage: It is used to show a validation message.inputHeight: It is used to denote the height of the input element.inputWidth: It is used to denote the width of the input width. Creating React Application And Installing Module: Step 1: Create a React application using the following command: npx create-react-app foldername Step 2: After creating your project folder i.e. foldername, move to it using the following command: cd foldername Step 3: After creating the ReactJS application, Install the required module using the following command: npm install evergreen-ui Project Structure: It will look like the following. Project StructureExample: Now write down the following code in the App.js file. Here, App is our default component where we have written our code. App.js import React from 'react' import { TextInput } from 'evergreen-ui' export default function App() { // State for Name const [name, setName] = React.useState('') return ( <div style={{ display: 'block', width: 700, paddingLeft: 30 }}> <h4>ReactJS Evergreen TextInput Component</h4> <TextInput onChange={(e) => setName(e.target.value)} placeholder="Enter your name" /> <br></br> Name: {name} </div> ); } Step to Run Application: Run the application using the following command from the root directory of the project: npm startOutput: Now open your browser and go to http://localhost:3000/, you will see the following output: Reference: https://evergreen.segment.com/components/text-input Comment More infoAdvertise with us Next Article ReactJS Evergreen Table Component G gouravhammad Follow Improve Article Tags : ReactJS ReactJS-Evergreen Similar Reads ReactJS Evergreen TagInput Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. TagInput Component allows the user to type in multiple values as tags. We can use the following approach in ReactJS to use 3 min read ReactJS Evergreen SearchInput Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. SearchInput Component allows the user to search by typing in the text input field provided to the user. We can use the foll 2 min read ReactJS Evergreen Textarea Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Textarea Component allows the user to type in longer content through the textarea input field. We can use the following app 3 min read ReactJS Evergreen Table Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Table Component allows the user to show all information from a table format. We can use the following approach in ReactJS t 6 min read ReactJS Evergreen Select Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Select Component allows the user to select an item from a list of options. We can use the following approach in ReactJS to 3 min read ReactJS Evergreen Alert Component React Evergreen is a popular front-end library with a set of React components for building beautiful products as this library is flexible, sensible defaults, and User friendly. Alert Component is used for are urgent interruptions, requiring acknowledgment, that informs the user about a situation. We 2 min read Like