You are browsing Nuxt 2 docs. Go to Nuxt 3 docs, or learn more about Nuxt 2 Long Term Support.

The layout property

Every file (first level) in the layouts directory will create a custom layout accessible with the layout property in the page component.


  • Type: String or Function (default: 'default')

Use the layout key in your pages components to define which layout to use:

export default {
  layout: 'blog',
  // OR
  layout(context) {
    return 'blog'
  }
}
Edit this page on GitHub Updated at Thu, Dec 18, 2025