Nuxt 3 Layout Slots: Complete Guide 2026

Master Nuxt 3 layout slots in 2026 for dynamic, reusable components. These powerful features allow injecting content into predefined layout areas, streamlining complex UIs without props drilling.

Our step-by-step guide covers setup, usage, fallbacks, and advanced patterns for Vue 3-powered apps.

Step 1: Define Layout Slots

Insight A

In layouts/default.vue , add named slots

Insight B

like <slot name="header" /> . This creates

In layouts/default.vue, add named slots like <slot name="header" />. This creates placeholders.

  • Use name for specificity.
  • Fallback content with <template #header>.
"nuxt 3 layout slots is most useful when readers can compare options quickly."

Step 2: Using Slots in Pages

Pros

In pages, fill slots: <NuxtLayout><template #header>Content</template></NuxtLayout>

Trade-offs

.

In pages, fill slots: <NuxtLayout><template #header>Content</template></NuxtLayout>.

  • 1. Wrap content in NuxtLayout.
  • 2. Target slots by name.
  • 3. Combine with head() for meta.

Step 3: Dynamic Slot Filling

Insight A

Pass data via provide/inject or composables

Insight B

for conditional content.

Pass data via provide/inject or composables for conditional content.

  • Use useState() for reactivity.
  • Handle multiple layouts.

Step 4: Nested Layouts

Pros

Extend with sub-layouts for dashboards or

Trade-offs

apps.

Extend with sub-layouts for dashboards or apps.

  • Define _type: 'nested'.
  • Cascade slots down.

Advanced: Scoped Slots & Fallbacks

missing content gracefully.

Pass props to slots and manage missing content gracefully.

  • <slot name="sidebar" :items="items">.
  • Global fallbacks in layout.

Best Practices 2026

Pros

Optimize for SSR, use TypeScript, and

Trade-offs

test with Vitest.

Optimize for SSR, use TypeScript, and test with Vitest.

  • Avoid deep nesting.
  • Leverage Nuxt UI modules.