Index of every page on this site: llms.txt

useFallbackTitle()

Usage

Use the auto-imported useFallbackTitle composable to access the fallback title that the module generates for the current page.

The title is resolved in this order:

  1. Error page title (e.g., 404 - Page not found) when a 404 or 500 error is active
  2. route.meta.title if set via definePageMeta()
  3. pages.{routeName}.title i18n translation key (when @nuxtjs/i18n is installed)
  4. Title-cased last URL path segment (e.g., /about-us becomes About Us)
const title = useFallbackTitle()
// Ref<string | null>

This is useful when building custom modules or components that need access to the same fallback title logic used internally by the module.

Return Value

  • Type: ComputedRef<string | null>

Returns null for the root path (/) when no route.meta.title is set.

Was this page helpful?