X Enterprises
Shared

MenuCard

Multi-variant menu item card (default, compact, horizontal) with dietary tags and add-to-order action.

Shared

These components are used across the full layer. XRdMenuCard is the richest shared component, supporting three layout variants and integrating with the useMenuCard() composable for config and dietary tag resolution.

Components

<XRdMenuCard />

Versatile menu item card supporting three display variants controlled by the useMenuCard() composable config (or overridden via the config prop). Uses dietary tag icons with color-coded classes and a formatted price string.

Variants:

  • default — vertical card with image, name, price, description, tag badges, calories, and prep time
  • compact — single-row item with name, price, and a + add button
  • horizontal — side-by-side image + content layout
<!-- Default variant from composable config -->
<XRdMenuCard :item="menuItem" />

<!-- Override to compact variant -->
<XRdMenuCard
  :item="menuItem"
  :config="{ variant: 'compact' }"
  @click="handleItemClick"
  @add="handleAddToOrder"
/>

Props

PropTypeDefaultDescription
itemMenuItemrequiredMenu item object with name, price, description?, image?, calories?, prepTime?, available?, featured?, currency?, tags?
configPartial<MenuCardConfig>undefinedOptional override for card config (variant, showImage, showDescription, showTags, showCalories, showPrepTime, imageAspect)

Emits

EventPayloadDescription
clickMenuItemEmitted when the card is clicked
addMenuItemEmitted when the + add button is clicked (compact/default variants)

AI Context

category: Shared
package: "@xenterprises/nuxt-x-restaurants"
components:
  - XRdMenuCard
use-when: >
  Rendering menu items in any context across the restaurant directory.
  Choose the variant (default/compact/horizontal) via the config prop or
  by setting menuCard config in useAppConfig().xRestaurants.
  Use compact for dense menu lists and horizontal for featured item showcases.
Copyright © 2026