---
url: https://lit-ui-router.dev/reference/ui-router-devtools/lazy/classes/LazyDevtoolsPlugin.md
---
[ui-router-devtools](../../index.md) / [lazy](../index.md) / LazyDevtoolsPlugin

# Class: LazyDevtoolsPlugin

Defined in: [ui-router-devtools/src/lazy.ts:41](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L41)

Records the router from registration; `mount(target)` loads `<ui-router-devtools>`, hands it the recorder and appends
it to `target`, and `unmount()` removes it while the recorder keeps running. Only the recorder loads with the plugin:
lit, d3 and the element load on the first `mount()`.

## Example

```ts
import { UIRouter } from '@uirouter/core';
import { LazyDevtoolsPlugin } from 'ui-router-devtools/lazy';

declare const router: UIRouter;

// Before the router starts, so the first transition is recorded.
const devtools = router.plugin(LazyDevtoolsPlugin, { timeResolves: true });

// Later, from a key binding or a button: the panel shows every transition since registration.
await devtools.mount(document.body);
```

## Implements

* [`UIRouterPlugin`](https://ui-router.github.io/core/docs/latest/interfaces/_interface_.uirouterplugin.html)

## Constructors

### Constructor

```ts
new LazyDevtoolsPlugin(router, options?): LazyDevtoolsPlugin;
```

Defined in: [ui-router-devtools/src/lazy.ts:53](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L53)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `router` | [`UIRouter`](https://ui-router.github.io/core/docs/latest/classes/_router_.uirouter.html) |
| `options?` | [`LazyDevtoolsPluginOptions`](../interfaces/LazyDevtoolsPluginOptions.md) |

#### Returns

`LazyDevtoolsPlugin`

## Properties

| Property | Modifier | Type | Default value | Description | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
|  `name` | `public` | `string` | `'devtools'` | The plugin's name in the router's plugin registry, shared with `DevtoolsPlugin`. | [ui-router-devtools/src/lazy.ts:43](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L43) |
|  `recorder` | `readonly` | [`Recorder`](../../index/interfaces/Recorder.md) | `undefined` | The recorder the plugin started; the panel follows it, and reporters can share it. | [ui-router-devtools/src/lazy.ts:45](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L45) |

## Accessors

### element

#### Get Signature

```ts
get element(): 
  | UIRouterDevtools
  | undefined;
```

Defined in: [ui-router-devtools/src/lazy.ts:62](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L62)

The `<ui-router-devtools>` in the DOM while the plugin is mounted.

##### Returns

| [`UIRouterDevtools`](../../define/interfaces/UIRouterDevtools.md)
| `undefined`

## Methods

### dispose()

```ts
dispose(): void;
```

Defined in: [ui-router-devtools/src/lazy.ts:128](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L128)

Stops the recorder and unmounts the element.

#### Returns

`void`

#### Implementation of

`UIRouterPlugin.dispose`

***

### mount()

```ts
mount(target): Promise<void>;
```

Defined in: [ui-router-devtools/src/lazy.ts:72](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L72)

Loads `<ui-router-devtools>`, hands it the recorder and appends it to `target`; the panel shows everything recorded
since registration. Resolves once the element is in the DOM, or without appending it when `unmount()` or `dispose()`
comes first. Rejects while the plugin is mounted or mounting, once it is disposed, and when loading or appending
fails, which leaves it unmounted.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `target` | `Element` |

#### Returns

`Promise`<`void`>

***

### unmount()

```ts
unmount(): void;
```

Defined in: [ui-router-devtools/src/lazy.ts:98](https://github.com/simshanith/lit-ui-router/blob/75b952f8fadad04517d78250d63980233930cad6/packages/ui-router-devtools/src/lazy.ts#L98)

Removes the element and keeps the recorder running, so the next `mount()` replays it; cancels a `mount()` still loading.

#### Returns

`void`
