Foundations
Layouts and page options
The four layouts, what each one renders and the definePageMeta options every page can set.
A page picks its layout with definePageMeta({ layout }). Without it, Nuxt uses default.
Layout | Used by | Renders | Needs a session |
|---|---|---|---|
default | Dashboards, apps, management and UI pages | Sidebar, navbar, breadcrumbs, customizer, command palette, toasts and the footer. | Yes |
auth | /login, /register, /forgot-password | An editorial split screen: a brand panel and the form column with language, theme and legal links. | No. Signed-in users are sent away. |
blank | /maintenance, /coming-soon | Only the page and the toasts. | No, when the page sets public: true |
landing-page | / and /landing/* | Only the page and the toasts. The landing renders its own navigation. | No |
The default layout
<template>
<v-app>
<AppCustomizer />
<AppSidebar />
<AppNavBar />
<v-main>
<v-container class="px-7" :fluid="isFluid">
<AppBreadcrumbs />
<v-defaults-provider :defaults="densityDefaults">
<slot />
</v-defaults-provider>
<AppCopyright />
</v-container>
</v-main>
<AppCommandPalette />
<AppToast />
</v-app>
</template>
AppToastandAppCommandPaletterender once here. Pages calluseToast()anduseCommandPalette(); they never render their own snackbar or dialog.- The container follows the customizer. It is boxed by default and full width when the user picks Full in the customizer, or when the page sets
fluid: true. - Table density comes from the user.
v-defaults-providerapplies the density appearance option to everyVDataTableon the page.
Page options
definePageMeta accepts these fields in the template:
Option | Type | Effect |
|---|---|---|
layout | string | The layout to use. Defaults to default. |
breadcrumb | i18n keys, strings or a function | The breadcrumb trail. Its last item also becomes the <title> of the page. |
hideBreadcrumbs | boolean | Hides the breadcrumb row. Full-height apps use it. |
fluid | boolean | Drops the boxed container. Only the full-height apps set it. |
public | boolean | Lets guests open the page. The auth and landing-page layouts are public already. |
permission | Permission | Requires a permission such as orders.view. Without it the user gets a 403. |
<script setup lang="ts">
definePageMeta({
breadcrumb: ['nav.ecommerceSection', 'nav.orders'],
permission: 'orders.view',
})
</script>
The breadcrumb items are translated when they are i18n keys, so the same array works in every language. A detail page can pass a function that receives the route and returns the record name.
Page structure
Pages inside the default layout share one structure, so every screen feels part of the same product:
BasePageHeaderwith the title, the description and the primary action in#actions. It renders theh1; do not wrap it inv-row.- An optional
BaseAlertwhen something needs attention (late orders, overdue invoices). - The content: a
BaseDataTable, a grid of cards or av-rowwith alg="8"main column and alg="4"side column.
Empty views use BaseEmptyState and outcomes after a submit use BaseResultState.
Wide content in a boxed page
Do not make a page fluid to fit a wide table. Give BaseDataTable responsive-columns so secondary columns hide while the table is narrower than a width you choose:
<BaseDataTable :headers="headers" :items="orders" :responsive-columns="{ channel: 900, city: 760 }" />