A beginner-friendly Body Mass Index (BMI) Calculator built using React. This project helped me practice functional components, state management with useState, form handling, conditional rendering, and clean CSS-based UI styling.
- Serves as the root component.
- Imports and renders the
Calccomponent frombmi.jsx.
- Built as a functional component using React hooks (
useState). - Includes form fields for weight and height.
- Performs BMI calculation using the imperial formula:
(weight in lbs / (height in inches)^2) × 703 - Classifies the result into:
- Underweight (BMI < 25)
- Healthy (25 ≤ BMI < 30)
- Overweight (BMI ≥ 30)
- Displays a custom popup modal instead of default browser alerts for invalid input.
- Provides a Reload button to reset the app state using
window.location.reload().
- Minimal and clean styling using custom CSS.
- Centers the form layout with flexbox.
- Applies soft gray background for input fields (
#f7f7f7). - Aligns buttons and BMI result text centrally.
- Styles the popup modal with shadow, padding, and close functionality.
useStatefor managing multiple UI states- Controlled components in forms
- Conditional rendering (popup logic)
- Clean and responsive UI using CSS
- Component-based structuring in React
- React (with Hooks)
- JavaScript (ES6+)
- HTML5 & CSS3 (no frameworks used)
git https://github.com/DevBehindYou/BMI_Calculator_using_React.git
cd BMI_Calculator_using_React
npm install
npm start