A simple and responsive React application built to practice and understand fundamental React concepts such as useState, controlled components, event handling, conditional rendering, and responsive UI design with Tailwind CSS.
The application allows users to:
- Enter their name in an input field
- Display the entered value on button click
- Reset the input and displayed value
- Experience a responsive UI that adapts to mobile, tablet, and desktop devices
The input value is managed through React state using useState.
Handles user interactions using:
onChangeonClick
Displays the entered name only after the user clicks the "Want to See Value!" button.
Clears both:
- Input field value
- Displayed output
Built with Tailwind CSS using responsive utility classes.
Uses React's useState hook to manage:
- User input
- Button state
- React.js
- JavaScript (ES6+)
- Tailwind CSS
- JSX
src/
│
├── component/
│ └── HandleInput.jsx
│
├── App.jsx
├── main.jsx
└── index.css
const [name, setName] = useState("");
const [isBtnPress, setBtnPress] = useState(false);<input
value={name}
onChange={handleChange}
/><p>{isBtnPress ? name : ""}</p><button onClick={showVal}>setName("");
setBtnPress(false);git clone https://github.com/your-username/react-input-handling-app.gitcd react-input-handling-appnpm installnpm run devThrough this project, I learned:
- How React state works
- How controlled inputs work
- How event handlers interact with state
- How React re-renders components
- How conditional rendering updates the UI
- How to build responsive layouts with Tailwind CSS
- The concept of two-way data binding in React
- Add form validation
- Add local storage support
- Display multiple users
- Add dark/light mode
- Convert into a complete form handling project
Muhammad Abdullah
Frontend Developer | React Learner | JavaScript Enthusiast
Always exploring modern web development and building projects to strengthen core concepts.
⭐ If you found this project helpful, consider giving it a star!