Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

useDocumentTitle

Set a document title and restore the previous owner on cleanup.

HooksEnvironment@gaudi/design-system/hooks/environment/use-document-titleView in StorybookSource

The most recently mounted enabled hook owns the title. Updating that owner updates the title; removing it restores the remaining owner or the original title, even if owners unmount out of order.

Usage

import { useDocumentTitle } from '@gaudi/design-system/hooks';
useDocumentTitle('Draft · Writing room');

Examples

Playground

Storybook

API

2 options
1 return value

Accessibility

Use concise page titles that identify the current content. Avoid rapidly changing titles or announcing pointer movement.

Notes

  • Use framework metadata for server-rendered page titles. This hook handles client-owned surfaces.