A responsive and interactive shopping cart application built with React and Tailwind CSS. This project demonstrates a fully functional cart system where users can view items, adjust quantities, and see real-time pricing updates with a 10% discount applied at checkout. It also includes a confirmation modal for item removal, ensuring a seamless user experience.
- Responsive Design: Adapts to various screen sizes, including desktop, tablet, and mobile.
- Interactive Cart System: Add, remove, and update item quantities dynamically.
- Total and Discounted Price Calculation: Shows real-time updates for total price and discounted price with a 10% discount.
- Delete Confirmation Modal: Provides a modal to confirm item deletion from the cart for improved user experience.
- Optimized Animations: Smooth hover effects, scaling, and transitions for an engaging UI.
Check out a live version of the project: Live Demo
-
Clone the repository:
git clone https://github.com/pawantech12/dynamic-ecommerce-cart.git cd dynamic-ecommerce-cart
-
Install dependencies:
npm install
-
Run the project:
npm run dev
-
Build the project for production:
npm run build
- View Items: Items are displayed in a scrollable cart format, each showing an image, title, price, and quantity.
- Update Quantity: Use
+
and-
buttons to adjust quantities for each item. - Delete Item: Click on the trash icon to delete an item. A confirmation modal will appear to ensure the action.
- View Price Calculations: The total price and discounted price are dynamically updated as items are added, removed, or quantities are changed.
public/
├── logo.png
src/
├── components/
│ ├── Loader.jsx
│ └── Navbar.jsx
├── pages/
| ├── Cart.jsx
| └── Products.jsx
├── context/
│ └── CartContext.jsx # Provides cart state and actions
└── App.jsx # Entry point and main app structure
- React: JavaScript library for building user interfaces.
- Tailwind CSS: Utility-first CSS framework for rapid UI development.
- React Icons: Library for including icons like
BsPlus
,BsTrash
, andHiMiniMinusSmall
. - Context API: Provides global state management for cart items.
Contributions, issues, and feature requests are welcome! Feel free to fork the repository and submit pull requests for improvements.
- Fork the repository.
- Create your branch:
git checkout -b my-feature
. - Commit your changes:
git commit -m 'Add a new feature'
. - Push to the branch:
git push origin my-feature
. - Open a pull request.
For questions or collaborations, please reach out via pawankumavat042@gmail.com
Or check out more of my work on GitHub
Thanks to the developers and designers who contributed to the React, Tailwind CSS, and React Icons libraries, which made this project possible.