Skip to Content

DishCard

Present a restaurant dish with a readable price, optional image, portion size, featured or popular labels, dietary information, and composable content slots.

DishCard presents caller-supplied menu content. It does not add a cart, ordering action, or payment behavior.

Beta API maturity: Beta.

TypeScript example

import {
  DishCard,
  type RestaurantDish,
} from "@puzzle-ui/pieces";

const dish: RestaurantDish = {
  id: "garden-bowl",
  name: "Garden bowl",
  description: "Grains, vegetables, and herbs.",
  price: { amount: 14.5, currency: "EUR" },
};

<DishCard dish={dish} locale="en-GB" />;

The variants adjust visual emphasis without imposing a fixed card height. Featured dishes receive a visible text badge; a dish can also be marked popular independently.

compact - Fit a dish into a dense list.

390 × 844

standard - Present the full dish description.

390 × 844

featured - Give a highlighted dish more visual weight.

390 × 844

API

PropTypeRequiredDefaultDescription
dishRestaurantDishYes—Caller-supplied dish data, including its price.
variant"compact" | "standard" | "featured"No"standard"Controls card spacing and image treatment.
headingAs"h3" | "h4" | "h5" | "h6"No"h3"Sets the dish heading element for its page context.
localestringNoRuntime localeBCP 47 locale used to format the supplied currency.
featuredLabelReactNodeNo"Featured"Visible badge for a featured variant or dish.
popularLabelReactNodeNo"Popular"Visible badge for a popular dish.
dietaryInformationVariantDietaryInformationVariantNo"compact"Presentation passed to DietaryInformation.
showDietaryDetailsPopoverbooleanNofalseAdds the shared dietary-details popover when data is supplied.
mediaSlotReactNodeNoDish imageReplaces the optional image with caller-provided media.
contentSlotReactNodeNo—Adds custom content after the dish details.
actionsReactNodeNo—Adds caller-owned links or controls; no order behavior is implied.
classNamestringNo—Additional class on the card.

RestaurantDish

RestaurantDish contains a unique id, name, and required CommerceMoney price. It also accepts optional description, CommerceImage, dietaryTags, allergens, featured, popular, and portionSize. An image uses the caller-provided alt text. Dietary and allergen values are displayed as supplied and are never inferred from the description.

Images, slots, and prices

The image is optional; when present it keeps a consistent aspect ratio and uses the supplied alternative text. Without an image the card keeps its normal content flow. mediaSlot replaces the image area, while contentSlot and actions extend the body. The caller is responsible for accessible names and semantics within custom slots.

Prices use locale-aware Intl.NumberFormat through the existing commerce formatter. Pass an explicit locale when server and browser output must be identical. The component displays one supplied amount and currency; it does not convert currencies or calculate taxes.

Responsive behavior and accessibility

  • Content wraps, images are optional, and cards have no forced height.
  • The price remains in a separate flexible row from long names and descriptions.
  • Featured and popular status is conveyed by visible text, not color alone.
  • headingAs lets the caller keep a logical heading hierarchy inside nested menu sections.
  • DietaryInformation always displays text labels, even when custom icons are supplied.

Theme support and customization

Cards, borders, prices, badges, and dietary labels consume Puzzle UI and Theme tokens. Use className for product-specific styling and the three React slots for custom media, content, or caller-owned actions.

Use the component in either supported framework; see Framework Integration for Next.js and TanStack Start guidance.