Skip to main content
React hook to retrieve page metadata (title and icon) for a given URL path. Useful for building custom navigation components, breadcrumbs, or displaying page information dynamically.

Signature

Parameters

string
required
URL path to find metadata for (e.g., “/products/all”, “/orders/:id”)Supports:
  • Static paths: /dashboard, /products/list
  • Dynamic segments: /orders/:orderId, /products/:slug
  • Nested paths: /settings/profile/edit

Returns

object
Returns an object containing page metadata if found, or null if the path is external or not found

Usage

Display Current Page Info

Custom Navigation Item

Dynamic Breadcrumbs

Page Title Component

Tab Navigation

How It Works

Path Matching

The hook searches through all registered modules and resources to find a matching path:
  1. Exact matches: /products/list matches exactly
  2. Dynamic segments: /orders/:id matches /orders/123
  3. Nested resources: Searches recursively through sub-resources
  4. External links: Returns null for paths starting with http:// or https://

Title Resolution

Titles are resolved in this order:
  1. Custom meta.title from module/resource definition
  2. Localized title if using LocalizedString
  3. Path converted to title case (e.g., “product-list” → “Product List”)

Example Module Definition

With this configuration:

Edge Cases

Path Not Found

External URLs

Root Path

Best Practices

  1. Always check for null: The hook may return null for external links or unknown paths
  2. Provide fallbacks: Display a default title/icon when metadata is not found
  3. Use with localization: Combine with defineI18nLabels for multi-language support
  4. Cache results: React automatically memoizes hook results, but consider useMemo for expensive operations