Skip to content

shadcn.io is an independent project built on shadcn/ui

Meal Kit Product Card Block for Svelte

A recipe box that scales: pick 2, 3, 4 or 6 servings and every ingredient amount, the price per serving and the total change, with the box drawn with one pack for each serving.

UI library: Ark UI

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Make the box fit the table with this meal kit product card for Svelte with Ark UI. A hairline frame with a plus mark on each corner holds one recipe box, lemon pesto gnocchi. A Toggle Group picks 2, 3, 4 or 6 servings and a ruled list scales every ingredient from a typed amount per serving, so 125 g of gnocchi per person reads "250 g" for two and "750 g" for six. The price per serving falls as the box grows and the total is that price times the servings, in integer cents. The cell at the end draws the box with one pack for each serving, shows the total and holds the block's one Shine Button, "Add to bag", with an Undo. The cook time is plain text. Nothing is stored or bought. Guides rule the bands. For recipe boxes and any product sold by how many it feeds.

FAQ

How do I change the recipe?

Edit INGREDIENTS: each has the amount for one serving and its unit in the singular and plural, so 2 tomatoes become 4 for two people. The price for one serving at each box size is in SIZES in cents.

How is the price worked out?

The per-serving price is typed for each box size, since bigger boxes cost less per head, and the total is that price times the servings. Both are shown, and neither is rounded.

Why do the ingredients come before the box?

The servings control sits over the list it changes, so you read the choice and its effect together, and the total and the Add button follow in the next cell.

What stays local, and how do I wire it for real?

The servings and the bag are page state. The bag is page state; nothing is stored, charged or sent. Replace the body of add and undo with calls to your cart. The picture is typed shapes: swap Picture for an img of the product.

How does it look on a phone?

One column: the servings and the ingredient list, then the box, the total and the button.

Is it accessible?

The servings are a named group of toggle buttons that works with the arrow keys, each amount is text in a list, the box is a named image that says how many packs it holds, and a change is announced by the polite status line.