StealThis .dev

Cookbook — Prep/cook time · difficulty · diet badges

A copy-ready recipe meta badge row for cookbook layouts, built in warm cream-and-tomato colors with inline SVG icons and accessible labels. Pill badges cover prep, cook, and total time with a clock glyph, servings, and a color-coded difficulty chip for easy, medium, and hard. Diet tags handle vegetarian, vegan, gluten-free, and keto, each with its own icon and tint. Three styled variants show full and compact rows, and a small demo toggles diet tags on and off while updating a polite aria-live summary.

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

Code

Prep/cook time · difficulty · diet badges

A single reusable meta row for recipe cards, rendered in three contexts. Each badge is a rounded pill with an inline SVG icon: a thermometer for prep, a steaming pot for cook, a clock for total time, and a paired-figures glyph for servings. Difficulty is a color-coded chip — sage green for easy, saffron for medium, tomato for hard — so the kitchen commitment reads at a glance. Beneath the meta row, dietary tags for vegetarian, vegan, gluten-free, and keto each carry their own icon and warm tint, with full text labels for screen readers.

The reference cards pair the badges with CSS-gradient food photography and food-emoji accents — a sun-dried tomato orecchiette, a charred broccolini bowl, and a red-wine braised short rib — to show the full row, a compact icon-led variant, and a high-difficulty keto example.

The interactive demo lets you toggle the four diet filters on and off. Each toggle is a real aria-pressed button; flipping one re-renders the live badge row, shows an empty-state line when nothing is selected, and rewrites a polite aria-live summary like This recipe is tagged Vegetarian and Gluten-free. Everything is keyboard-usable with visible focus rings, and the layout collapses to a single column by 720px.

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