![]() |
VOOZH | about |
We are going to learn how to create a translucent text input in React JS. We are going to create a translucent animated text input using framer-motion and styled components.
Step 1: Now, you will start a new project using create-react-app so open your terminal and type:
npx create-react-app translucent-input-boxStep 2: After creating your project folder i.e. translucent-input-box , move to it using the following command.
cd translucent-input-boxStep 3: Add the npm packages you will need during the project:
npm install framer-motion styled-componentsProject Structure:
The updated dependencies in package.json file will look like:
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4",
}
Example: Below is the implementation of the above approach
Step to Run Application: Run the application using the following command from the root directory of the project :
npm start
Output: Now open your browser and go to http://localhost:3000