Genesis
@beta

useBrowserSearchParams

Browser-native {@link SearchParamsAdapter} built on the History API. Reads the current query string and writes updates via `pushState`/`replaceState`, staying reactive to `popstate` events. No router required.

packages/ui/src/navigation.tsx

Import
Subpath export: @marktiderman/genesis-ui
import { useBrowserSearchParams } from "@marktiderman/genesis-ui";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

useBrowserSearchParams

Browser-native {@link SearchParamsAdapter} built on the History API. Reads the current query string and writes updates via `pushState`/`replaceState`, staying reactive to `popstate` events. No router required.

No declared props.

DefaultLink

Default link — a plain `<a>`. No router required.

No declared props.

isPathActive

Default active-path matcher, mirroring React Router's `NavLink` (prefix match, with `/` treated as exact). Consumers can override via an `isActive` prop where components accept one. `activePath` may carry a query and hash (`pathname + search + hash`). An item whose `to` has neither compares against the path part only, exactly as before. An item that opts in by putting a query or hash in its `to` (`/admin?tab=users`, `/settings#profile`) is active only when the path matches exactly AND every query param it names has the same value in `activePath` (extra params such as `&page=2` are ignored) AND, if it names a hash, the hash is equal.

No declared props.

resolveNavigation

Resolve where `pathname` sits in a logical navigation tree. Pure: it never reads browser history or `window`. A node matches when its pattern matches a leading run of WHOLE path segments (`/my` matches `/my/tasks`, never `/my-other`). Among matches the winner is decided by positional specificity: at the first position where one pattern is static and the other a `$param`, the static one wins (so `/clients/new` beats `/clients/$clientId` whatever the sibling order, and `/my` beats `/$space/tasks` for `/my/tasks`). Otherwise the pattern matching more segments wins, then the deeper tree node. Non-matching nodes are still searched, so a match keeps its logical ancestors even when their URLs differ.

No declared props.

resolveNavigationZones

Lay an app's zones over its navigation tree (ADR 0003 §1 and §4): which zone the location is in, each zone's pages, the global pages and the roll-up. Pure, so web and native shells use the same answer; an app with no zones gets every top page in `global` and no `zone`. ```ts const { zone } = resolveNavigationZones(tree, pathname, { zones: ZONES }); const theme = THEMES[zone?.id ?? "home"]; // a theme per zone ``` A zone id the tree names but `zones` doesn't list is ignored (its pages read as global), so a stale id never invents a zone.

No declared props.

IsPathActiveOptions

Options for {@link isPathActive}.

No declared props.

NavigationNode

One node of a logical navigation hierarchy. `path` is a route pattern whose segments are either static (`clients`) or named params (`$clientId`). A node's place in the tree is its LOGICAL parent, which need not share its URL prefix — `/clients/$clientId` can sit under `/dashboard`.

No declared props.

NavigationSubNav

How a navigation node's children are drawn (`NavigationNode.subNav`): `"tabs"`, `"sidebar"` (sub-items), `"list"`, `"hub"`, `"section"` (the legacy default) or `"off"`.

No declared props.

NavigationZone

One zone of an app's navigation (ADR 0003 §1): an ordered entry with an id the tree's `zone` names, a label and an optional icon (the app's own icon type, `I`).

No declared props.

ResolvedNavigation

Result of {@link resolveNavigation}. `current`, `parent` and every `trail` entry are shallow copies of their tree nodes with `path` interpolated from `params` (a param the URL did not supply stays as `$name`).

No declared props.

ResolvedNavigationZones

Result of {@link resolveNavigationZones}.

No declared props.

defaultNavigate

Default navigate — a full-page navigation. No router required.

No declared props.