Skip to main content
Type-safe links to documentation pages with compile-time TypeScript validation and runtime checking.

Basic Usage

With custom text:

Properties

string
required
Page path from docs.json. Must match navigation entries exactly.Examples: quickstart, guides/setup-guide, components/type-tree
ReactNode
Link text. Defaults to the page path if omitted.

Type Safety

PageLink validates links in two ways: Compile-time - TypeScript checks against ValidPages.d.ts:
Runtime - Browser checks against ValidPages Set and applies styling: Broken links get:
  • Red color (#ef4444)
  • Red dotted underline (2px)
  • Red wavy text decoration
  • Tooltip showing the error
Learn more: Link Validation

Examples

Page Paths

Page paths must match docs.json navigation entries:
Path normalization: leading / is added automatically if missing. Links break when pages are removed from docs.json, renamed, or moved.
  1. Check TypeScript error in IDE
  2. Verify page exists in docs.json navigation
  3. Update target to match exact path
  4. Run mint-tsdocs generate if navigation changed

Best Practices

Use PageLink for guides/concepts, RefLink for API references
Use exact paths from docs.json
Avoid hardcoded absolute paths
Fix broken links before committing

Troubleshooting

Run mint-tsdocs generate to copy components to docs/snippets/tsdocs/
Due to an MDX extension bug, try:
  1. Use relative path while editing: "../snippets/tsdocs/PageLink.jsx"
  2. Get autocomplete
  3. Change back to absolute: "/snippets/tsdocs/PageLink.jsx"

RefLink

API reference links

Link Validation

How validation works

Custom Styles

Style broken links