---
url: https://lit-ui-router.dev/reference/ui-router-devtools/index/functions/viewTree.md
---
[ui-router-devtools](../../index.md) / [ui-router-devtools](../index.md) / viewTree

# Function: viewTree()

```ts
function viewTree(views): ViewNode[];
```

Defined in: [ui-router-devtools/src/views.ts:50](https://github.com/simshanith/lit-ui-router/blob/31f3b09934f0d5fb680137a7c51356c2acec408d/packages/ui-router-devtools/src/views.ts#L50)

Nests views by their `fqn`: a view sits inside the view named by its `fqn` without the last segment. A view whose
enclosing view is not registered is drawn at the top. Siblings keep the order they are given in.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `views` | readonly [`ViewInfo`](../interfaces/ViewInfo.md)\[] |

## Returns

[`ViewNode`](../interfaces/ViewNode.md)\[]
