Skip to content

Grocery Delivery App Home with Deals

Grocery delivery app home screen with address sheet, delivery time badge, deals carousel, category grid, frequently bought list with add buttons and a live cart.

Also known as: grocery app ui, grocery delivery app home screen, online supermarket app design, quick commerce app ui, food shopping app template

Grocery Delivery App Home with Deals live demo

Open in new tab

Tailwind CSS code (HTML, CSS, JS)

A grocery delivery app home screen built with Tailwind CSS: a delivery address header, a delivery time badge, a swipeable deals carousel, a category grid with icons, a frequently bought list with add buttons and a live cart. It is an HTML mobile template for mobile websites and PWAs and can be packaged as a native app with Capacitor. Use it as the home screen UI of an online supermarket, quick commerce or farm shop app.

How it works

The root .gdh-app is a phone-width column. The header button opens #gdh-address-sheet, a native <dialog> styled as a bottom sheet with radio cards; Deliver here writes the choice into [data-gdh-address]. The green badge shows the arrival time, which script.js calculates from the current time plus ETA_MINUTES, and the deals heading shows the weekday the offers end.

The deals row [data-gdh-track] uses CSS scroll snap. A scroll listener works out which .gdh-deal card is in view and marks the matching .gdh-dot with aria-current; tapping a dot scrolls to that deal. Each deal has a round add button (data-gdh-add) that turns into a check once the item is in the cart.

The category grid uses .gdh-cat toggle buttons with inline SVG icons. Tapping one filters the frequently bought list by data-gdh-cat-of, and the search field filters it by product name; applyFilter() combines both, renames the list heading and shows Show all and an empty message when needed.

Every product row ends in a [data-gdh-ctrl] element with name, price and starting quantity in data attributes. renderCtrl() draws an add button at zero and a minus / count / plus stepper above zero. The cart badge, the sticky .gdh-cartbar and #gdh-cart-sheet (lines, subtotal, delivery fee and free delivery hint) all update from the same cart object. Checkout runs a short simulated order and shows a confirmation with the arrival time. The tab bar switches between the home panel and a simple panel for the other tabs.

Customization

  • --gdh-accent, --gdh-accent-dark and --gdh-soft on .gdh-app in style.css: the green of buttons, badges, the cart bar and active tab.
  • --gdh-radius in style.css: corner radius of cards, icon tiles, inputs and buttons (16px).
  • FREE_DELIVERY_FROM and DELIVERY_FEE in script.js: the free delivery threshold and the fee shown in the cart sheet.
  • ETA_MINUTES and DEAL_DAYS_LEFT in script.js: arrival time and the weekday in the deals heading.
  • data-gdh-price and data-gdh-qty on each [data-gdh-ctrl]: product price and the quantity already in the cart.
  • flex: 0 0 85% in .gdh-deal: how much of the next deal card peeks in.
  • Replace the setTimeout in the checkout handler with fetch() to your order API.

Use cases

  • Grocery and supermarket delivery apps: the main home screen with offers and quick reorders.
  • Quick commerce PWAs: 15-minute delivery with a visible arrival time.
  • Farm shops and organic box schemes: weekly boxes as deals and regular buys below.
  • Pharmacy or convenience store apps: the same layout with other categories.

Accessibility

Buttons have clear labels such as "Add Bananas to cart", steppers are grouped with an aria-label, and category buttons use aria-pressed. The carousel is a labelled, keyboard-scrollable region with slide labels, and the active tab uses aria-current="page". Cart changes, filters, address changes and the order result are announced in a polite live region. Both bottom sheets close with Escape or the backdrop and return focus to the button that opened them. All touch targets are at least 44 px. The product photos come from Unsplash; replace them with your own images.

Grocery Delivery App Home with Deals at a glance

Framework
Tailwind CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Tailwind CSS, fonts.googleapis.com, Bootstrap Icons
Layout
Mobile-first app screen, centred on wider screens
Category
Mobile Home & Feed
License
Free for personal and commercial use

Questions about this template

Can I use the Grocery Delivery App Home with Deals code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Tailwind CSS and fonts.googleapis.com and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Can I turn this screen into an iOS or Android app?

Yes. It is plain HTML, CSS and JavaScript, so it works in a mobile website or progressive web app as it is. To ship it as a store app, put it in the web folder of a Capacitor or Cordova project and build it for iOS and Android; replace the sample data with calls to your own API.

How does it look on a desktop screen?

The screen is designed for phones. On wider screens it stays at phone width in the middle of the page, so it still looks like an app. The live demo opens at mobile width; use the Tablet and Desktop buttons to check other sizes.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
  • <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap">
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Grocery Delivery App Home with Deals – free Tailwind CSS mobile home & feed template
Grocery Delivery App Home with Deals · free Tailwind CSS mobile home & feed template

More Mobile Home & Feed

Event Tickets App Home with Categories – free Bootstrap 6 mobile home & feed template

Event Tickets App Home with Categories

Dark event tickets app home screen with category chips, a this-weekend event carousel, upcoming events list and a ticket bottom sheet with quantity stepper and total.

Real Estate App Home with Map Toggle – free Bootstrap 6 mobile home & feed template

Real Estate App Home with Map Toggle

Real estate app home screen with search, property type chips, listing cards, a list/map toggle with price pins and a filter bottom sheet for price, bedrooms and new listings.

Food Delivery App Home Screen – free Tailwind CSS mobile home & feed template

Food Delivery App Home Screen

Food delivery app home screen with address picker sheet, search, category chips, promo banner, popular restaurant cards with ratings and a bottom tab bar.

Bookstore App Home with Reading Shelf – free Pure CSS mobile home & feed template

Bookstore App Home with Reading Shelf

Bookstore app home screen with a currently reading card and progress sheet, genre chips, a bestseller row of CSS book covers, add-to-bag buttons and a bottom tab bar.

News Reader App Home – free Pure CSS mobile home & feed template

News Reader App Home

News reader app home screen with section tabs, a top story card, article list with thumbnails and read time, bookmark toggles, a saved view and a bottom tab bar.

Recipe App Home with Categories – free Bootstrap 5 mobile home & feed template

Recipe App Home with Categories

Recipe app home screen with search, meal type category chips, a recipe of the day card, a quick recipes list with time and difficulty, filters sheet and bottom tabs.