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

# Interface: UIViewInjectedProps\<T>

Defined in: [packages/lit-ui-router/src/interface.ts:174](https://github.com/simshanith/lit-ui-router/blob/92660184d9980e90964f7e785d5efeb5cae43b42/packages/lit-ui-router/src/interface.ts#L174)

Props injected into routed components by the `<ui-view>` element.

These props provide access to the current transition, resolved data,
and the router instance. Components can use these to access routing
state and navigate programmatically.

## Examples

**Using in a template function**

```ts
const UserDetail: RoutedLitTemplate = (props) => {
  const { resolves, router } = props!;
  return html`
    <h1>User: ${resolves?.user?.name}</h1>
    <button @click=${() => router.stateService.go('users')}>
      Back to Users
    </button>
  `;
};
```

**Using in a LitElement class**

```ts
class UserDetail extends LitElement {
  _uiViewProps?: UIViewInjectedProps<{ user: User }>;

  render() {
    const user = this._uiViewProps?.resolves?.user;
    return html`<h1>${user?.name}</h1>`;
  }
}
```

## See

* [UIRouter](https://ui-router.github.io/core/docs/latest/classes/_router_.uirouter.html)
* [Transition](https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition.html)

## Type Parameters

| Type Parameter | Default type | Description |
| ------ | ------ | ------ |
|  `T` *extends* [`DefaultResolvesType`](DefaultResolvesType.md) | [`DefaultResolvesType`](DefaultResolvesType.md) | The shape of the resolved values object |

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
|  `resolves` | `T` | Resolved data from state declarations; a `NOWAIT` resolve arrives as its promise | [packages/lit-ui-router/src/interface.ts:180](https://github.com/simshanith/lit-ui-router/blob/92660184d9980e90964f7e785d5efeb5cae43b42/packages/lit-ui-router/src/interface.ts#L180) |
|  `router` | [`UIRouter`](https://ui-router.github.io/core/docs/latest/classes/_router_.uirouter.html) | The UIRouter instance for programmatic navigation | [packages/lit-ui-router/src/interface.ts:182](https://github.com/simshanith/lit-ui-router/blob/92660184d9980e90964f7e785d5efeb5cae43b42/packages/lit-ui-router/src/interface.ts#L182) |
|  `transition?` | [`Transition`](https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition.html) | The current transition (if one is in progress) | [packages/lit-ui-router/src/interface.ts:178](https://github.com/simshanith/lit-ui-router/blob/92660184d9980e90964f7e785d5efeb5cae43b42/packages/lit-ui-router/src/interface.ts#L178) |
