veryfront/context

Import

TypeScript
import { PageContextProvider, usePageContext } from "veryfront/context";

Examples

TSX
import { PageContextProvider, usePageContext } from "veryfront/context";

Exports

Components

NameDescriptionSource
PageContextProviderProvides page context to route and MDX descendants. Page-authored fields (frontmatter, slug, headings) come from the pageContext prop; the location fields (path, query, params) are derived from the router so they stay reactive and there is a single source of truth - usePageContext() exposes the same query/pathname as useRouter(). When rendered outside a RouterProvider (no live router) it falls back to the seed's own location.source

Functions

NameDescriptionSource
usePageContextReads the current page context.source

Types

NameDescriptionSource
MdxHeadingHeading metadata extracted from MDX content.source
PageContextProviderPropsProps accepted by <PageContextProvider>.source
PageContextValuePage context exposed to route and MDX components.source