X Enterprises
nuxt-x-restaurants

Shared Components

Site-wide components used across all pages — navigation header, footer, star rating display, and menu item card.

Shared Components

These four components are used across the full layer. XRdNavbar and XRdFooter are typically placed in the layout file. XRdStarRating is a utility display component usable anywhere a rating needs to be shown. XRdMenuCard is the richest shared component, supporting three layout variants and integrating with the useMenuCard() composable for config and dietary tag resolution.

Components

<XRdNavbar />

Site-wide header built on UHeader. Logo image and text, nav links, and mobile drawer are all driven by useAppConfig().xRestaurants. Nav link active state is derived from the current route.

<!-- app.vue or layout file -->
<XRdNavbar />

Props

None. Configuration is read entirely from appConfig.xRestaurants:

Config keyDescription
xRestaurants.logoLogo image URL
xRestaurants.logo.iconFallback icon name (default: i-lucide-map-pin)
xRestaurants.logo.textLogo text
xRestaurants.nameFallback site name
xRestaurants.navbar.signInLabelSign in button label
xRestaurants.navbar.linksArray of { label, to } nav link objects

<XRdFooter />

Dark (bg-gray-900) full-width footer with a 4-column layout: brand + social icons, Quick Links, a Cuisines column, and a newsletter subscription form. Link targets are currently hardcoded to the default restaurant directory routes.

<!-- app.vue or layout file -->
<XRdFooter />

Props

None.


<XRdStarRating />

Renders a row of 5 star icons (filled, half, or empty) with an optional numeric rating label and review count. Uses i-lucide-star and i-lucide-star-half-2 icons.

<XRdStarRating
  :rating="4.7"
  :count="128"
  :show-rating="true"
  :show-count="true"
/>

Props

PropTypeDefaultDescription
ratingnumber0Numeric rating value (0–5, supports decimals for half stars)
countnumber0Total review count displayed in parentheses
showRatingbooleantrueWhether to show the numeric rating value next to the stars
showCountbooleanfalseWhether to show the review count next to the stars

<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)

Events

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

AI Context

package: "@xenterprises/nuxt-x-restaurants"
prefix: XRd
category: Shared
components:
  - XRdNavbar
  - XRdFooter
  - XRdStarRating
  - XRdMenuCard
use-when: >
  XRdNavbar and XRdFooter belong in the Nuxt layout file (app.vue or layouts/default.vue).
  XRdStarRating can replace any inline star rendering across listing cards, profile heroes,
  and review items — it handles half-star logic automatically.
  XRdMenuCard is the preferred component for rendering menu items in any context;
  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