Docs
useDocumentTitle

Dynamically update the document title. Pass a string, and the document title updates whenever the value changes.

Loading...

Installation

pnpm dlx shadcn@latest add https://usekit.kiron.dev/k/use-document-title

Usage

"use client"
 
import { useDocumentTitle } from "@/hooks/use-document-title"
 
export function Component() {
  useDocumentTitle("New title for my page")
 
  return <div>...</div>
}

API Reference

Parameters

NameTypeDescriptionDefault ValueOptional
titlestringThe new title to set for the document.""No