Sanity Library Reference Docs
    Preparing search index...
    • Sets the browser's document title, automatically including the app's name from the manifest.

      This follows the same convention as Sanity Studio workspaces, where the workspace name is always present in the title:

      • With a view title: <viewTitle> | <appTitle>
      • Without a view title: <appTitle>

      The Sanity dashboard appends | Sanity to produce the final browser tab title.

      Parameters

      • OptionalviewTitle: string

        An optional view-specific title to prepend to the app title.

      Returns void

      import {useWindowTitle} from '@sanity/sdk-react'

      function MoviesList() {
      useWindowTitle('Movies')
      return <div>...</div>
      }

      // Browser tab: "Movies | My App | Sanity"
      // Call without arguments to show just the app title
      function AppRoot() {
      useWindowTitle()
      return <Outlet />
      }

      // Browser tab: "My App | Sanity"