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

# Class: LitViewConfig

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

The view config [UIRouterLit](UIRouterLit.md) builds for each lit view declaration,
implementing `@uirouter/core`'s `ViewConfig`.

`<ui-view>` renders a view only when its config is a `LitViewConfig`; a
renderer that draws lit views outside `<ui-view>` makes the same
`instanceof` check before it reads `viewDecl`.

## Implements

* `ViewConfig`

## Constructors

### Constructor

```ts
new LitViewConfig(path, viewDecl): LitViewConfig;
```

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

Create a new LitViewConfig.

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `path` | `PathNode`\[] | The path nodes for this view |
| `viewDecl` | [`_ViewDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_._viewdeclaration.html) | The view declaration |

#### Returns

`LitViewConfig`

## Properties

| Property | Modifier | Type | Default value | Description | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
|  `$id` | `public` | `number` | `...` | Unique identifier for this view config | [packages/lit-ui-router/src/core.ts:45](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/core.ts#L45) |
|  `loaded` | `public` | `boolean` | `true` | Whether the view configuration has been loaded | [packages/lit-ui-router/src/core.ts:47](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/core.ts#L47) |
|  `path` | `public` | `PathNode`\[] | `undefined` | The path nodes for this view | [packages/lit-ui-router/src/core.ts:55](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/core.ts#L55) |
|  `viewDecl` | `public` | [`_ViewDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_._viewdeclaration.html) | `undefined` | The view declaration | [packages/lit-ui-router/src/core.ts:56](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/core.ts#L56) |

## Methods

### load()

```ts
load(): Promise<LitViewConfig>;
```

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

Load the view configuration.

#### Returns

`Promise`<`LitViewConfig`>

A promise that resolves to this view config

#### Implementation of

`ViewConfig.load`
