๐ React Modal Cart App
A sleek, responsive e-commerce UI built using ReactJS(React Hooks), Tailwind CSS and the Fake Store API.
โจ Features
- โ
Product Listing from Fake Store API
- ๐ Search bar with
useRef
focus on page load
- ๐ Filter by category
- โ Add to Cart modal with item count
- โ Remove from Cart button to remove the product(item) from Cart.
- โ Alert Message will show if the product is already added to cart.
- ๐พ Local Storage to preserve cart items across refresh
- โก Responsive Design using Tailwind CSS
- ๐ง React Hooks:
useState
, useEffect
, useRef
โ Technologies Used
- โ ReactJS
- ๐จ Tailwind CSS
- ๐ฆ Fake Store API
- ๐
localStorage
for data persistence
๐งช How It Works
- ๐ On page load, the search input auto-focuses using useRef.
- ๐ Products are filtered based on search and selected category.
- ๐ Clicking "Cart" icon opens a modal, disables background interaction.
- โ "Add to Cart" button adds the item to Cart and โ Alert Message shown if the product is already added to Cart
- โ "Remove from Cart" button deletes item from the Cart
- ๐พ Cart state is stored and retrieved using LocalStorage.
๐ UI Highlights
- ๐งน Clean Cart Layout ๐
- โก Aligned Buttons using Flexbox
- ๐ Search Icon added using Heroicons
- ๐ผ Responsive Grid for products