VitePress Runtime API

The VitePress Runtime API provides Vue composition functions and helper utilities for use in custom themes, Vue components, and Markdown pages. Key composables include useData() for accessing site and page metadata, useRoute() for current route information, useRouter() for programmatic navigation, and withBase() for base URL resolution. Components include Content for rendering compiled Markdown and ClientOnly for browser-only rendering.

API entry from apis.yml

apis.yml Raw ↑
aid: vitepress:runtime-api
name: VitePress Runtime API
description: The VitePress Runtime API provides Vue composition functions and helper utilities for use
  in custom themes, Vue components, and Markdown pages. Key composables include useData() for accessing
  site and page metadata, useRoute() for current route information, useRouter() for programmatic navigation,
  and withBase() for base URL resolution. Components include Content for rendering compiled Markdown and
  ClientOnly for browser-only rendering.
humanURL: https://vitepress.dev/reference/runtime-api
baseURL: https://vitepress.dev
tags:
- API
- Composables
- Documentation
- JavaScript
- Runtime
- Vue
properties:
- type: Documentation
  url: https://vitepress.dev/reference/runtime-api
- type: Reference
  url: https://vitepress.dev/reference/site-config