> For AI agents: the complete documentation index is available at https://rspress.rs/llms.txt, the full documentation bundle is available at https://rspress.rs/llms-full.txt.

# ~~usePageData~~

`usePageData` exposes the metadata of the current page so you can render it inside custom components or utilities.

- **Type:** `() => PageData`

The returned `PageData` object includes information such as the page title, route path, frontmatter, and site-wide data. This hook is available on both the server and client, making it suitable for SSR and SSG-safe rendering.

> Capabilities have been split into [`usePage`](https://rspress.rs/ui/hooks/use-page.md), [`usePages`](https://rspress.rs/ui/hooks/use-pages.md), and [`useSite`](https://rspress.rs/ui/hooks/use-site.md); prefer these dedicated hooks as needed.

```tsx
import { usePageData } from '@rspress/core/runtime';

export default function PageTitle() {
  const { page } = usePageData();
  return <h1>{page.title}</h1>;
}
```

> Related: you can pair this hook with [`useLang`](https://rspress.rs/ui/hooks/use-lang.md) or [`useVersion`](https://rspress.rs/ui/hooks/use-version.md) to tailor content by locale or documentation version.
