Configuration
app.config.ts and runtimeConfig reference for @xenterprises/nuxt-x-restaurants.
Configuration
All per-site behaviour is configured under the xRestaurants key in app.config.ts. API credentials and the public site URL come from runtime config / environment variables.
Your overrides must live in
app/app.config.ts (Nuxt 4 srcDir). An app.config.ts at the project root is ignored by the config merge and silently yields only the layer defaults below.app.config.ts
export default defineAppConfig({
xRestaurants: {
// Brand
name: "My Restaurant Directory",
domain: "mysite.com", // used by useDomain() to build /public/domains/:domain URLs
logo: "/logos/my-logo.webp",
// Top-level nav
navbar: {
links: [
{ label: "Explore", to: "/restaurants" },
{ label: "Articles", to: "/articles" },
],
},
// Homepage section copy and assets — every section also takes
// `enabled: false` to hide it (hero, featured, popular, newRestaurants,
// localGuide, latestStories, showcase, faq).
homePage: {
hero: {
title: "Find the Best Dining",
description: "Explore top-rated restaurants...",
backgroundImage: "https://...",
searchButtonLabel: "Search",
cuisinePlaceholder: "Cuisine",
locationPlaceholder: "Neighborhood",
},
featured: {
title: "Featured Places",
description: "Hand-picked selections.",
viewAllLink: "/restaurants",
viewAllLabel: "View All",
viewButtonLabel: "View",
},
latestStories: {
title: "Latest Food Stories",
description: "Get inspired by chef interviews, seasonal guides...",
readMoreLabel: "Read Article",
},
popular: {
title: "Popular This Week",
viewDetailsLabel: "View Details",
},
localGuide: {
title: "Your Guide to Local Dining",
paragraphs: [],
},
faq: {
title: "Frequently Asked Questions",
items: [{ label: "How do I search?", content: "Use the filters..." }],
},
},
// When enabled (or when the domain is not found by the API), /
// renders XRDComingSoon on the bare layout.
comingSoon: {
enabled: false,
title: "",
description: "",
backgroundImage: "",
launchDate: "",
},
// Menu card visual config (read by XRDMenuCard / XRDProfileMenuItem / useMenuCard())
menuCard: {
showImage: true,
showDescription: true,
showTags: true,
showSpiceLevel: false,
showCalories: false,
showPrepTime: false,
variant: "default", // 'default' | 'compact' | 'horizontal'
imageAspect: "video", // 'square' | 'video' | 'wide'
dietaryTags: [
{ id: "vegetarian", label: "Vegetarian", icon: "i-heroicons-leaf", color: "green" },
],
},
// Filter groups + sidebar behaviour (read by useFilters() / useRestaurantFilters())
filters: {
enabled: true, // false hides the /restaurants filters aside
title: "Filters",
groups: [], // FilterGroup[] — see schema below
showClearAll: true,
mobileBreakpoint: "lg", // 'sm' | 'md' | 'lg' | 'xl'
// Optional: directory aside sections — subset, order, labels,
// default-open. Omit for the full default set.
// sections: [
// { id: "cuisine", label: "Cuisine", defaultOpen: true },
// { id: "price" }, // location | cuisine | price | amenities | dietary | vibe
// ],
},
// Analytics tracking (useAnalytics())
analytics: {
enabled: true, // false disables all analytics tracking
},
},
});
Schema Reference
Brand & nav
| Key | Type | Default | Description |
|---|---|---|---|
name | string | 'Restaurant Destinations' | Directory name used in metadata, headings, footer, navbar. |
domain | string | 'testingrestaurants.com' | Domain used by useDomain() to build /public/domains/:domain API URLs. Always override per site. |
logo | string | '/logos/Restaurant Destinations.webp' | Logo image path displayed in XRDNavbar (and as fallback in XRDComingSoon). |
navbar.links | { label: string, to: string }[] | 4 default links | Navigation links rendered by XRDNavbar (defaults: Explore Restaurants, Popular Restaurants, Features, Articles). |
navbar.signInLabel | string | — | Optional sign-in button label (declared in the type augmentation). |
Homepage
Every homepage section accepts enabled: false to hide it — homePage.<section>.enabled where <section> is one of hero, featured, popular, newRestaurants, localGuide, latestStories, showcase, faq (all render by default).
| Key | Type | Default | Description |
|---|---|---|---|
homePage.hero.title | string | 'Find the Best Dining in Your Neighborhood' | Hero section headline. |
homePage.hero.description | string | 'Explore top-rated restaurants, cozy cafes, and hidden gems…' | Hero section subtext. |
homePage.hero.backgroundImage | string | Unsplash URL | Hero background image URL. |
homePage.hero.searchButtonLabel | string | 'Search' | Hero search button label. |
homePage.hero.cuisinePlaceholder | string | 'Cuisine' | Hero cuisine select placeholder. |
homePage.hero.locationPlaceholder | string | 'Neighborhood' | Hero location select placeholder. |
homePage.featured.title | string | 'Featured Places' | Featured restaurants section title. |
homePage.featured.description | string | 'Hand-picked selections for your next dining adventure.' | Featured section description. |
homePage.featured.viewAllLink | string | '/restaurants' | "View all" link target. |
homePage.featured.viewAllLabel | string | 'View All' | "View all" link label. |
homePage.featured.viewButtonLabel | string | 'View' | Per-card view button label. |
homePage.latestStories.title | string | 'Latest Food Stories' | Latest Stories section title. |
homePage.latestStories.description | string | 'Get inspired by chef interviews…' | Latest Stories section description. |
homePage.latestStories.readMoreLabel | string | 'Read Article' | Per-story CTA label. |
homePage.popular.title | string | 'Popular This Week' | Popular This Week section title. |
homePage.popular.viewDetailsLabel | string | 'View Details' | Per-card "view details" label. |
homePage.localGuide.title | string | 'Your Guide to Local Dining' | Local Dining Guide section title. |
homePage.localGuide.paragraphs | string[] | [] | Optional paragraphs override. |
homePage.faq.title | string | 'Frequently Asked Questions' | FAQ section title. |
homePage.faq.items | { label, content }[] | 3 default entries | FAQ section entries. |
Coming soon
| Key | Type | Default | Description |
|---|---|---|---|
comingSoon.enabled | boolean | false | Force-render XRDComingSoon on /. |
comingSoon.title | string | — (unset) | Hero title on the coming-soon page. |
comingSoon.description | string | — (unset) | Hero description. |
comingSoon.backgroundImage | string | — (unset) | Background image (falls back to the homepage hero background). |
comingSoon.launchDate | string | — (unset) | Launch date — stored as a string, format free. |
Menu card
| Key | Type | Default | Description |
|---|---|---|---|
menuCard.showImage | boolean | true | Show menu item image in XRDMenuCard. |
menuCard.showDescription | boolean | true | Show menu item description. |
menuCard.showTags | boolean | true | Show dietary/tag badges on menu items. |
menuCard.showSpiceLevel | boolean | false | Show spice level indicator. |
menuCard.showCalories | boolean | false | Show calories count. |
menuCard.showPrepTime | boolean | false | Show preparation time. |
menuCard.variant | 'default' | 'compact' | 'horizontal' | 'default' | Menu card layout variant. |
menuCard.imageAspect | 'square' | 'video' | 'wide' | 'video' | Menu card image aspect ratio (default variant only). |
menuCard.dietaryTags | DietaryTag[] | 5 defaults | Dietary tag definitions used by useMenuCard(). |
Filters
| Key | Type | Default | Description |
|---|---|---|---|
filters.enabled | boolean | true | Show the filters aside on /restaurants. false hides it entirely. |
filters.title | string | 'Filters' | Filters section title. |
filters.sections | FilterSection[] | undefined | Directory aside (XRDFilters) sections. When set, this array is the complete list — controls which sections render, their order, labels, and which start expanded. Omit for the full default set. |
filters.groups | FilterGroup[] | [] | Generic filter group definitions read by useFilters() (the opt-in XRDFiltersAsideFilters / XRDFiltersActiveFilters components — unrelated to the directory aside). |
filters.showClearAll | boolean | true | Show "Clear All" button in filter UI. |
filters.mobileBreakpoint | 'sm' | 'md' | 'lg' | 'xl' | 'lg' | Breakpoint below which the filters collapse into a drawer. |
FilterSection shape
interface FilterSection {
id: "location" | "cuisine" | "price" | "amenities" | "dietary" | "vibe"
label?: string // override the section heading
defaultOpen?: boolean // start the section expanded
}
Analytics
| Key | Type | Default | Description |
|---|---|---|---|
analytics.enabled | boolean | true | Master switch for useAnalytics() tracking. false disables all events (page views, clicks, search impressions). |
FilterGroup shape
interface FilterGroup {
id: string
label: string
type: "checkbox" | "range" | "select" | "search" | "radio"
options?: { label: string, value: string | number, count?: number, disabled?: boolean, icon?: string }[]
min?: number
max?: number
step?: number
placeholder?: string
collapsed?: boolean
multiple?: boolean
unit?: string
defaultValue?: unknown
}
Runtime Config / Environment Variables
| Variable | Required | Description |
|---|---|---|
NUXT_PUBLIC_API_ENDPOINT | Yes | Base URL for the restaurant API used by useDomain() and useAnalytics(). Set to an empty string to hit mock routes in your own server/routes/public/** (see the quickstart). |
NUXT_PUBLIC_SITE_URL | No | Public site URL — exposed as runtimeConfig.public.siteUrl (returned by useDomain()). |
NUXT_PUBLIC_SITE_NAME | No | Site name — exposed as runtimeConfig.public.siteName. |
NUXT_SITE_URL | No | Site URL for @nuxtjs/seo. |
NUXT_SITE_NAME | No | Site name for @nuxtjs/seo. |
JSON-LD site identity (
siteUrl, siteName, siteLogo used by useSchema() / useSiteMeta()) is read from the xSchema namespace provided by the @xenterprises/nuxt-x-schema layer — not from xRestaurants. Since v0.10.0 the layer extends nuxt-x-schema directly, so JSON-LD renders out of the box; set xSchema in app/app.config.ts for your site's values.AI Context
package: "@xenterprises/nuxt-x-restaurants"
config-key: xRestaurants
use-when: >
Customising the restaurant directory name, domain, logo, navbar links,
homepage copy and assets, coming-soon mode, menu card layout/dietary
tags, or filter panel behaviour. Set NUXT_PUBLIC_API_ENDPOINT to connect
useDomain() and useAnalytics() to your restaurant API.
