🚧 Rspress 2.0 document is under development
close

usePage

usePage exposes metadata extracted from the current Markdown or MDX page.

  • Type: () => { page: PageDataLegacy['page'] }

The page object contains parsed frontmatter and runtime details such as title, toc, lang, version, routePath, pagePath, description, headingTitle, pageType, and lastUpdatedTime, allowing you to build contextual UI for the active document.

Use usePage together with useSite or usePages when you need both per-page metadata and global site information.