React_Modal_Task Tailwind Templates

React_modal_task

๐Ÿ›’ Responsive React Add to Cart app using Fake Store API, Tailwind CSS, and modal cart view.

๐Ÿ›’ 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

Top categories

Loading Svelte Themes