Skip to content
Source
Sign inSign up
TanStack/devtools
Open History to see the last commit

basic-setup.md

61 lines1.8 KB

1---
2title: Basic setup
3id: basic-setup
4---
5​
6TanStack Devtools provides you with an easy-to-use and modular client that allows you to compose multiple devtools into one easy-to-use panel.
7​
8## Setup
9​
10Install the [TanStack Devtools](https://www.npmjs.com/package/@tanstack/angular-devtools) library. This will install the devtools core as well as provide you with the Angular-specific adapter.
11​
12```bash
13npm i @tanstack/angular-devtools
14```
15​
16Next, in the root of your application, import the `TanStackDevtoolsComponent` from `@tanstack/angular-devtools` and add it to your template.
17​
18```typescript
19import { Component } from '@angular/core'
20import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'
21​
22@Component({
23 selector: 'app-root',
24 standalone: true,
25 imports: [TanStackDevtools],
26 template: `
27 <app-content />
28 <tanstack-devtools />
29 `,
30})
31export class App {}
32```
33​
34Import the desired devtools and provide them to the `TanStackDevtools` via the `[plugins]` input along with a label for the menu.
35​
36```typescript
37import { Component } from '@angular/core'
38import { TanStackDevtools } from '@tanstack/angular-devtools'
39import type { TanStackDevtoolsAngularPlugin } from '@tanstack/angular-devtools'
40import { AngularQueryDevtoolsPanel } from '@tanstack/angular-query-devtools'
41​
42@Component({
43 selector: 'app-root',
44 standalone: true,
45 imports: [TanStackDevtools],
46 template: `
47 <app-content />
48 <tanstack-devtools [plugins]="plugins" />
49 `,
50})
51export class AppComponent {
52 plugins: Array<TanStackDevtoolsAngularPlugin> = [
53 {
54 name: 'Angular Query',
55 render: AngularQueryDevtoolsPanel,
56 },
57 ]
59```
60​
61Finally, add any additional configuration you desire to the `TanStackDevtools`. More information can be found under the [TanStack Devtools Configuration](../../configuration) section.