Skip to content

Shravan-025/Calculator

Repository files navigation

🧮 React Calculator

A modern and responsive calculator built with React, JavaScript, and Tailwind CSS.


📸 Preview

Calculator Preview


🚀 Live Demo

👉 https://calculator-nine-peach-30.vercel.app/


✨ Features

  • Basic arithmetic operations

    • Addition
    • Subtraction
    • Multiplication
    • Division
  • Responsive modern UI

  • Keyboard support

  • Decimal number handling

  • Backspace functionality

  • Clear expression

  • Expression evaluation

  • Real-time display updates

  • Clean component-based React architecture


🛠️ Built With

  • React
  • JavaScript (ES6+)
  • Tailwind CSS
  • CSS
  • Vite

📂 Project Structure

Calculator
│
├── public
│   └── preview.png
│
├── src
│   ├── components
│   │   ├── Buttons.jsx
│   │   ├── Screen.jsx
│   │   └── ...
│   │
│   ├── logic.js
│   ├── App.jsx
│   └── main.jsx
│
├── package.json
└── README.md

⌨️ Keyboard Shortcuts

Key Action
0-9 Numbers
+ Addition
- Subtraction
* Multiplication
/ Division
. Decimal
Enter Calculate
Backspace Delete Last Character
Escape Clear

📱 Responsive Design

The application is designed to work smoothly across:

  • Desktop
  • Laptop
  • Tablet
  • Mobile Devices

📖 What I Learned

While building this project, I practiced:

  • React Components
  • State Management with useState
  • Event Handling
  • Keyboard Events
  • Conditional Rendering
  • JavaScript Expression Handling
  • Tailwind CSS Layouts
  • Responsive Design
  • Component Reusability

🔮 Future Improvements

  • History Panel
  • Scientific Calculator Mode
  • Light/Dark Theme
  • Percentage Operation
  • Memory Functions
  • Keyboard Highlight Animation
  • Better Expression Parser

⚙️ Installation

Clone the repository

git clone https://github.com/Shravan-025/Calculator.git

Go to the project directory

cd Calculator

Install dependencies

npm install

Run the development server

npm run dev

⭐ Show your support

If you found this project helpful, consider giving it a ⭐ on GitHub.


👨‍💻 Author

Shravan Patel

GitHub: https://github.com/Shravan-025

LinkedIn: www.linkedin.com/in/shravan-patel-b02546325

About

A simple calculator with react and tailwind

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages