Skip to content
usefy

useDocumentTitle

Browser & device

Set document.title with restore-on-unmount

Install

$ npm install @usefy/use-document-title

Quick start

useDocumentTitle.tsx
import { useDocumentTitle } from "@usefy/use-document-title";

useDocumentTitle(`Inbox (${unread})`);

API reference

useDocumentTitle(title, options?)options.restoreOnUnmount (default false) restores the title present at mount when the component unmounts.

Go deeper

This page is the quick reference. For every example, prop, and edge case, read the full README — or open Storybook to change props live.

More in browser & device