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.

      Works in both Dashboard runtimes: it manages the document title over the Comlink connection, and no-ops under the message bus, where the Dashboard host owns the title.

      Parameters

      • OptionalviewTitle: string

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

      Returns void

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

      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"