---
url: https://lit-ui-router.dev/v1/reference/lit-ui-router/core/routerContext.md
---
[lit-ui-router](../index.md) / routerContext

# Variable: routerContext

```ts
const routerContext: RouterContext;
```

Defined in: packages/lit-ui-router/src/context.ts:118

The context key `<ui-router>` answers for: the router instance.

Speaks the community `context-request` protocol without depending on
`@lit/context` — the key is a stable object, matched by identity, and the
branded type is the one `createContext()` would have produced. An element
written against `@lit/context` consumes it unchanged:

## Example

```ts
import { consume } from '@lit/context';
import { LitElement } from 'lit';
import { routerContext } from 'lit-ui-router/context';
import type { UIRouterLit } from 'lit-ui-router';

class MyElement extends LitElement {
  @consume({ context: routerContext })
  router!: UIRouterLit;
}
```

## See

* [requestRouter](requestRouter.md) for the dependency-free request
* [UIRouterLitElement.seekRouter](../components/UIRouterLitElement.md#seekrouter) for the house `ui-router-context` event
