Configuration

Title templates

Declare title.default and title.template in a layout when descendants should share a suffix. The template does not affect a page in the same segment, and a template in a terminal page has no descendants. A title.absolute value bypasses inherited templates. Use distinct titles for distinct pages. Example is the root metadata fragment; keep the existing root layout. Source: https://nextjs.org/docs/app/api-reference/functions/generate-metadata. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

Formal Syntax & Structure

nextjs syntaxnextjs
title: { default: string, template: string }

Working Example

Example Snippetnextjs
// app/layout.tsx (metadata fragment)import type {Metadata} from 'next';export const metadata:Metadata={title:{default:'River Books',template:'%s | River Books'}};// In app/catalog/page.tsx export metadata={title:'Catalog'}.// Expected descendant title: Catalog | River Books.// In app/legal/page.tsx use title:{absolute:'Legal information'}.
Next.js Reference