---
url: https://lit-ui-router.dev/reference/lit-ui-router/types/Context.md
---
[lit-ui-router](../index.md) / Context

# Type Alias: Context\<KeyType, ValueType>

```ts
type Context<KeyType, ValueType> = KeyType & {
  __context__: ValueType;
};
```

Defined in: [packages/lit-ui-router/src/context.ts:18](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/context.ts#L18)

A context key branded with the type of the value it references, as the
[community context protocol](https://github.com/webcomponents-cg/community-protocols/blob/main/proposals/context.md)
defines it. Structurally identical to `@lit/context`'s `Context`, so keys
cross between the two without a cast.

## Type Parameters

| Type Parameter |
| ------ |
|  `KeyType` |
|  `ValueType` |

## Type Declaration

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `__context__` | `ValueType` | Phantom brand: the type of the value this key references. | [packages/lit-ui-router/src/context.ts:20](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/context.ts#L20) |
