StealThis .dev

Cookbook — Auto Shopping List (from selected recipes)

A meal-prep shopping list that builds itself. Toggle recipe chips and every ingredient folds into one categorized grocery list — Produce, Meat, Dairy, and Pantry — with duplicate quantities summed per unit, so three pinches of garlic across two dishes become a single tidy line. Check items off against a live progress bar, edit or remove a line inline, watch the X items by Y aisles summary update, and copy, print, or share the finished list. Warm editorial cookbook styling, fully responsive, and print-friendly.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Auto Shopping List (from selected recipes)

A meal-planning panel with a sticky recipe picker on the left and a self-assembling grocery list on the right. Each recipe is a toggle chip with a gradient “photo” thumbnail and a serving line; tapping one folds its ingredients into the list, tapping again pulls them back out. Two dishes come pre-selected so the list is alive on load.

The aggregation does the tedious part. Ingredients are merged by name and summed per unit — overlapping cherry tomatoes from the orzo and the tacos collapse into one weighed line, while to taste items like basil and parsley stay un-quantified. Everything is bucketed into Produce, Meat & Fish, Dairy & Eggs, and Pantry, sorted by aisle so the list reads like a real shopping run. A running summary reports X items · Y aisles · Z recipes.

Each row has a checkbox that strikes the item through and advances a sage progress bar with an aria-live count, plus inline edit (override the quantity) and remove actions. Copy drops a plain-text, aisle-grouped list onto the clipboard, Share uses the Web Share API with a clipboard fallback, and Print hides the controls for a clean paper list. The two-column layout collapses to one at 720px.

Illustrative UI only — recipes & nutrition data are fictional, not dietary advice.