useTitle
A hook that set title of the page.
Overview
A hook that set title of the page.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useTitle.jsonA hook that set title of the page.
Examples
Default usage
API
useTitle(title: string, options?: Options);Params
| Property | Description | Type | Default |
|---|---|---|---|
| restoreOnUnmount | Whether to restore the previous page title when the component is unmounted | boolean | false |