Skip to main content
cngx-src documentation

CNGX_TAB_URL_MATCH_STRATEGY

Tokenv0.1.0WCAG AA

InjectionToken<CngxTabUrlMatch>

Description#

Swap point for how a routed tab set decides which tab the URL belongs to. Default createTabUrlMatch.

Override when neither shipped policy fits: locale-segment-insensitive comparison (/de/rounds and /en/rounds are the same tab), matching on a route data key instead of the path, or a permission-aware read that skips tabs the user cannot open. routeFor only changes what a tab's route is; this changes how it is compared.

Mirrors CNGX_TABS_COMMIT_ACTION on the write side: the navigation a tab switch performs is already swappable, so the read that mirrors navigation back onto activeIndex should be too.

Type#

InjectionToken<CngxTabUrlMatch>

Provided in#

'root'