X Enterprises
nuxt-x-app

Layout

Full-application shell with responsive sidebar, header, breadcrumbs, and navigation components.

Layout

The Layout category provides the full application shell and every navigation primitive needed to build a consistent admin or SaaS interface. XALayout orchestrates the responsive sidebar, header, and content area; the individual sub-components can also be used independently. All components integrate with the optional useXNavigation composable for config-driven nav without prop drilling.

Components

<XALayout />

Top-level shell that renders a fixed desktop sidebar, an animated mobile slide-in sidebar with backdrop, and a full-height main content area. Sidebar width animates between expanded and collapsed states. Integrates with useXNavigation automatically.

<XALayout color="primary" sidebar-width="16rem">
  <template #logo="{ collapsed }">
    <img v-if="!collapsed" src="/logo.svg" />
  </template>
  <template #nav="{ collapsed }">
    <XALayoutSidebarNav :items="navItems" :collapsed="collapsed" />
  </template>
  <NuxtPage />
</XALayout>

Props

PropTypeDefaultDescription
sidebarCollapsedBooleanundefinedControlled collapsed state of the sidebar
sidebarWidthString'16rem'Width of the expanded sidebar
collapsedWidthString'4rem'Width of the collapsed sidebar
colorString'primary'Active color for navigation items
backgroundColorString''Background color class for the page
sidebarBackgroundColorString''Background color class for the sidebar
sidebarTextModeString''Text color mode for sidebar: 'light' or 'dark'

Slots

SlotPropsDescription
logo{ collapsed }Brand logo area
nav{ collapsed, textMode }Sidebar navigation content
sidebar-footer{ collapsed }Sidebar footer area
sidebar-user{ collapsed, textMode }Sidebar user menu area
breadcrumbsHeader breadcrumb override
header-actionsAdditional header action buttons
userHeader user menu override
secondary-navBelow-header secondary navigation
defaultMain page content

<XALayoutHeader />

Sticky top header bar. The left side shows a mobile menu toggle and breadcrumbs (or top nav items). The right side renders search, action buttons with optional badges, and a user menu.

<XALayoutHeader
  :show-breadcrumbs="true"
  :search="{ enabled: true, placeholder: 'Search...', shortcut: '⌘K' }"
  :actions="[{ icon: 'i-lucide-bell', label: 'Notifications', badge: 3 }]"
/>

Props

PropTypeDefaultDescription
showMobileMenuBooleantrueShow the hamburger menu button
showBreadcrumbsBooleantrueShow the breadcrumbs component
showUserMenuBooleantrueShow the default user menu
searchObject{ enabled: false }Search config: { enabled, placeholder, shortcut }
actionsArray[]Header action buttons: [{ icon, label, to, action, badge }]
topNavItemsArrayundefinedNavigation items to render in the header
useNavigationBooleantrueMerge config from useXNavigation composable

<XALayoutSidebar />

The desktop sidebar panel. Supports collapsed/expanded states, collapsible toggle, custom brand, navigation items, footer items, and a user menu slot. Adapts border and text colors via textMode.

<XALayoutSidebar
  v-model:collapsed="collapsed"
  :items="navItems"
  :color="'primary'"
  text-mode="light"
  collapsible
/>

Props

PropTypeDefaultDescription
collapsedBooleanundefinedControlled collapsed state
collapsibleBooleanundefinedShow the collapse toggle button
widthStringundefinedSidebar width
collapsedWidthString'64px'Width when collapsed
itemsArrayundefinedNavigation items array
footerItemsArrayundefinedFooter navigation items
brandObjectundefinedBrand config: { title, logo, to }
userObjectundefinedUser config passed to XALayoutSidebarUserMenu
positionStringSidebar position (e.g., 'right')
colorString'primary'Active item color
textModeString'dark'Text color mode: 'light' or 'dark'
mobileBooleanfalseRenders in mobile mode (shows close button)
useNavigationBooleantrueMerge config from useXNavigation composable

<XALayoutSidebarNav />

Renders an array of navigation item objects. Items may include section headers (item.section), dividers (item.divider), or regular nav entries delegated to XALayoutSidebarNavItem.

<XALayoutSidebarNav
  :items="[
    { section: 'Main' },
    { label: 'Dashboard', icon: 'i-lucide-home', to: '/' },
    { divider: true },
    { label: 'Settings', icon: 'i-lucide-settings', to: '/settings' }
  ]"
  :collapsed="false"
  color="primary"
  text-mode="dark"
/>

Props

PropTypeDefaultDescription
itemsArray[]Navigation items array
collapsedBooleanfalseCollapsed display mode
colorString'primary'Active item color
textModeString'dark'Text color mode: 'light' or 'dark'

<XALayoutSidebarNavItem />

Single navigation item. Supports NuxtLink routing, action callbacks, badges, nested children (collapsible in expanded mode, dropdown in collapsed mode), and tooltip labels when collapsed.

<XALayoutSidebarNavItem
  :item="{
    label: 'Reports',
    icon: 'i-lucide-chart-bar',
    to: '/reports',
    badge: { label: 'New', color: 'success' },
    children: [
      { label: 'Monthly', to: '/reports/monthly' }
    ]
  }"
  :collapsed="false"
  color="primary"
  text-mode="dark"
/>

Props

PropTypeDefaultDescription
itemObjectrequiredNav item: { label, icon, to, action, badge, children, disabled }
collapsedBooleanfalseCollapsed display mode
colorString'primary'Active item color
textModeString'dark'Text color mode: 'light' or 'dark'
nestedBooleanfalseRenders as a child item with reduced padding

<XALayoutSidebarUserMenu />

Avatar-based dropdown at the bottom of the sidebar. Shows user name and email when expanded; shows avatar only when collapsed. Includes a built-in theme switcher (light/dark/system) and emits logout and navigate events.

<XALayoutSidebarUserMenu
  :user="{ name: 'Jane Doe', email: 'jane@example.com', avatar: '/avatar.png' }"
  :collapsed="false"
  text-mode="dark"
  show-online-status
/>

Props

PropTypeDefaultDescription
userObject{}User object: { name, email, avatar }
collapsedBooleanfalseCollapsed display mode
showOnlineStatusBooleanfalseShow green online indicator dot
textModeString'dark'Text color mode: 'light' or 'dark'
itemsArrayundefinedCustom dropdown menu items

<XALayoutUserMenu />

Header-level user dropdown. Renders an avatar button (or icon + name fallback) that opens a dropdown with an info header, theme switcher, settings link, and logout link.

<XALayoutUserMenu
  name="Jane Doe"
  email="jane@example.com"
  avatar="/avatar.png"
  settings-path="/account"
  logout-path="/auth/logout"
/>

Props

PropTypeDefaultDescription
nameString''Display name
emailString''Email address
avatarString''Avatar image URL
showAvatarBooleantrueShow avatar vs. icon+name fallback
showThemeSwitcherBooleantrueInclude theme toggle in dropdown
settingsPathString'/settings'Route for settings menu item
logoutPathString'/auth/logout'Route for logout menu item
itemsArray[]Additional dropdown menu items
useNavigationBooleantrueMerge config from useXNavigation composable

<XALayoutMobileSidebar />

Mobile slide-over sidebar driven by USlideover. Renders brand header, nav items, and optional footer items. Closes automatically on navigation when closeOnNavigate is true.

<XALayoutMobileSidebar
  v-model:open="mobileOpen"
  :items="navItems"
  color="primary"
  close-on-navigate
/>

Props

PropTypeDefaultDescription
openBooleanfalseControls slide-over visibility
itemsArrayundefinedNavigation items
footerItemsArrayundefinedFooter navigation items
brandObjectundefinedBrand config: { title, logo, to }
closeOnNavigateBooleantrueClose on route change
useNavigationBooleantrueMerge config from useXNavigation composable
colorString'primary'Active item color
textModeString'dark'Text color mode: 'light' or 'dark'

<XALayoutPageHeader />

Standardized page header block. Shows optional breadcrumbs row, a title with optional back button, description (or slot), actions slot, and a tab bar that highlights the active route.

<XALayoutPageHeader
  title="Users"
  description="Manage your team members"
  :back="{ to: '/admin', label: 'Admin' }"
  :tabs="[
    { label: 'All', to: '/users' },
    { label: 'Admins', to: '/users/admins', badge: 2 }
  ]"
  sticky
>
  <template #actions>
    <UButton icon="i-lucide-plus">Invite</UButton>
  </template>
</XALayoutPageHeader>

Props

PropTypeDefaultDescription
titleStringrequiredPage title
descriptionStringundefinedSubtitle text
backObjectundefinedBack button: { to, label? }
breadcrumbsArrayundefinedBreadcrumb items: [{ label, to? }]
tabsArrayundefinedTab items: [{ label, to, badge? }]
stickyBooleanfalseStick header to top on scroll
loadingBooleanfalseShow skeleton placeholders

<XALayoutBreadcrumbs />

Accessible breadcrumb trail. When auto is true and no items are provided, it auto-generates crumbs from the current route path.

<!-- Auto-generated from route -->
<XALayoutBreadcrumbs />

<!-- Manual items -->
<XALayoutBreadcrumbs :items="[{ label: 'Home', to: '/' }, { label: 'Settings' }]" />

Props

PropTypeDefaultDescription
itemsArray[]Manual breadcrumb items: [{ label, to? }]
autoBooleantrueAuto-generate from route path when items is empty

<XALayoutContentNav />

Settings-style secondary sidebar. On desktop it renders a sticky sidebar nav panel; on mobile it collapses to a USelect dropdown.

<XALayoutContentNav
  label="Account"
  :items="[
    { label: 'Profile', to: '/settings/profile', icon: 'i-lucide-user' },
    { label: 'Security', to: '/settings/security', icon: 'i-lucide-shield' }
  ]"
/>

Props

PropTypeDefaultDescription
itemsArray[]Navigation items: [{ label, to, icon? }]
labelString''Section label shown above the list

<XALayoutSecondaryNav />

Horizontal sub-navigation bar rendered below the header. Supports links and action callbacks, an optional back button, and a right-side #actions slot.

<XALayoutSecondaryNav
  :items="[
    { label: 'Overview', to: '/project' },
    { label: 'Tasks', to: '/project/tasks', badge: 12 }
  ]"
  show-back
  @back="$router.back()"
/>

Props

PropTypeDefaultDescription
itemsArray[]Nav items: [{ label, to?, icon?, badge?, action? }]
labelString''Accessible label (not displayed)
showBackBooleanfalseShow back arrow button

<XALayoutResponsiveNav />

Renders a UNavigationMenu (horizontal) on md+ screens and a UDropdownMenu on smaller screens. The dropdown button label automatically reflects the active route item.

<XALayoutResponsiveNav
  :items="[
    { label: 'Dashboard', to: '/', icon: 'i-lucide-home' },
    { label: 'Reports', to: '/reports', icon: 'i-lucide-chart-bar' }
  ]"
/>

Props

PropTypeDefaultDescription
itemsArrayrequiredNavigation items: [{ label, to?, icon?, click? }]

AI Context

category: Layout
package: "@xenterprises/nuxt-x-app"
use-when: >
  Building an admin panel, dashboard, or SaaS application that needs a
  full-page shell with a collapsible sidebar. Use XALayout as the root
  shell, XALayoutPageHeader on individual pages, XALayoutBreadcrumbs or
  XALayoutSecondaryNav for in-page orientation, and XALayoutContentNav
  for settings-style sub-pages. All components integrate with the
  useXNavigation composable for config-driven setup.
Copyright © 2026