API Reference
Cinder.registerRoute
Register explicit route activation and active-state behavior for a semantic route key.
Need the shortest path?
Use Quick Start when you want the smallest working route → scan → graph → run flow first.
Something feels off?
Inspect scan output, graph state, active route/context, and dispatch in a practical order.
Need the full surface?
Browse all runtime methods, hooks, extension points, and lifecycle APIs.
Use registerRoute() when a tagged route needs explicit navigation or active-state logic beyond standard anchor, selector, or path metadata.
Example
ts
6 lines
Cinder.registerRoute({
key: 'reports',
path: '/reports',
navigate: () => router.navigate('/reports'),
isActive: () => window.location.pathname === '/reports',
});Route definition shape
ts
8 lines
{
key: string;
path?: string;
selector?: string;
aliases?: string[];
navigate?: () => void | Promise<void>;
isActive?: () => boolean;
}When to use it
Use route registration when:
- route activation is not just an anchor click
- your router needs explicit app-side navigation
- active-state logic is more complex than path or
aria-currenthints - you want aliases or selector hints attached to a route definition directly
Tag-only note
You do not need route registration for every app. Standard anchor/path-based navigation should still work tag-only where the browser surface already exposes enough route information.
Related pages
Continue reading