shadcn-ahooks

useTitle

A hook that set title of the page.

Overview

A hook that set title of the page.

Documentation and Examples

Installation

Open in
pnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.json
npx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.json
yarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.json
bun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.json

A hook that set title of the page.

Examples

Default usage

API

useTitle(title: string, options?: Options);

Params

PropertyDescriptionTypeDefault
restoreOnUnmountWhether to restore the previous page title when the component is unmountedbooleanfalse

On this page