Open History to see the last commit
1---
2title: Quick Start
3id: quick-start
4---
5β
6TanStack Devtools is a framework-agnostic devtool for managing and debugging devtools plugins across React, Preact, Solid, Vue, Svelte, and Angular. Pick your framework below to get started.
7β
8## React
9β
10Install the devtools and the Vite plugin:
11β
12```bash
13npm install -D @tanstack/react-devtools @tanstack/devtools-vite
14```
15β
16Add the `TanStackDevtools` component to the root of your application:
17β
18```tsx
19import { StrictMode } from 'react'
20import { createRoot } from 'react-dom/client'
21import { TanStackDevtools } from '@tanstack/react-devtools'
22β
23import App from './App'
24β
25createRoot(document.getElementById('root')!).render(
26 <StrictMode>
27 <App />
28 <TanStackDevtools />
29 </StrictMode>,
30)
31```
32β
33To add plugins, pass them via the `plugins` prop. Each plugin needs a `name` and a `render` element:
34β
35```tsx
36import { StrictMode } from 'react'
37import { createRoot } from 'react-dom/client'
38import { TanStackDevtools } from '@tanstack/react-devtools'
39import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'
40import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
41β
42import App from './App'
43β
44createRoot(document.getElementById('root')!).render(
45 <StrictMode>
46 <App />
47 <TanStackDevtools
48 plugins={[
49 {
50 name: 'TanStack Query',
51 render: <ReactQueryDevtoolsPanel />,
52 },
53 {
54 name: 'TanStack Router',
55 render: <TanStackRouterDevtoolsPanel />,
56 },
57 ]}
58 />
59 </StrictMode>,
60)
61```
62β
63## Preact
64β
65Install the devtools and the Vite plugin:
66β
67```bash
68npm install -D @tanstack/preact-devtools @tanstack/devtools-vite
69```
70β
71Add the `TanStackDevtools` component using Preact's `render()` function:
72β
73```tsx
74import { render } from 'preact'
75import { TanStackDevtools } from '@tanstack/preact-devtools'
76β
77import App from './App'
78β
79render(
80 <>
81 <App />
82 <TanStackDevtools />
83 </>,
84 document.getElementById('root')!,
85)
86```
87β
88To add plugins, pass them via the `plugins` prop:
89β
90```tsx
91import { render } from 'preact'
92import { TanStackDevtools } from '@tanstack/preact-devtools'
93β
94import App from './App'
95β
96render(
97 <>
98 <App />
99 <TanStackDevtools
100 plugins={[
101 {
102 name: 'Your Plugin',
103 render: <YourPluginComponent />,
104 },
105 ]}
106 />
107 </>,
108 document.getElementById('root')!,
109)
110```
111β
112## Solid
113β
114Install the devtools and the Vite plugin:
115β
116```bash
117npm install -D @tanstack/solid-devtools @tanstack/devtools-vite
118```
119β
120Add the `TanStackDevtools` component using Solid's `render(() => ...)` pattern:
121β
122```tsx
123import { render } from 'solid-js/web'
124import { TanStackDevtools } from '@tanstack/solid-devtools'
125β
126import App from './App'
127β
128render(() => (
129 <>
130 <App />
131 <TanStackDevtools />
132 </>
133), document.getElementById('root')!)
134```
135β
136To add plugins, pass them via the `plugins` prop:
137β
138```tsx
139import { render } from 'solid-js/web'
140import { TanStackDevtools } from '@tanstack/solid-devtools'
141import { SolidQueryDevtoolsPanel } from '@tanstack/solid-query-devtools'
142import { TanStackRouterDevtoolsPanel } from '@tanstack/solid-router-devtools'
143β
144import App from './App'
145β
146render(() => (
147 <>
148 <App />
149 <TanStackDevtools
150 plugins={[
151 {
152 name: 'TanStack Query',
153 render: <SolidQueryDevtoolsPanel />,
154 },
155 {
156 name: 'TanStack Router',
157 render: <TanStackRouterDevtoolsPanel />,
158 },
159 ]}
160 />
161 </>
162), document.getElementById('root')!)
163```
164β
165## Vue
166β
167Install the Vue devtools adapter:
168β
169```bash
170npm install -D @tanstack/vue-devtools
171```
172β
173> The Vite plugin (`@tanstack/devtools-vite`) is optional for Vue but recommended if you want features like enhanced console logs and go-to-source.
174β
175Add the `TanStackDevtools` component in your root template:
176β
177```vue
178<script setup lang="ts">
179import { TanStackDevtools } from '@tanstack/vue-devtools'
180</script>
181β
182<template>
183 <App />
184 <TanStackDevtools />
185</template>
186```
187β
188To add plugins, define them as an array and pass them via the `:plugins` binding. Vue uses `component` instead of `render` in plugin definitions:
189β
190```vue
191<script setup lang="ts">
192import { TanStackDevtools } from '@tanstack/vue-devtools'
193import type { TanStackDevtoolsVuePlugin } from '@tanstack/vue-devtools'
194import { VueQueryDevtoolsPanel } from '@tanstack/vue-query-devtools'
195β
196const plugins: TanStackDevtoolsVuePlugin[] = [
197 { name: 'Vue Query', component: VueQueryDevtoolsPanel },
198]
199</script>
200β
201<template>
202 <App />
203 <TanStackDevtools :plugins="plugins" />
204</template>
205```
206β
207## Svelte
208β
209Install the devtools:
210β
211```bash
212npm install @tanstack/svelte-devtools
213```
214β
215Add the `TanStackDevtools` component to the root of your application:
216β
217```svelte
218<script lang="ts">
219 import { TanStackDevtools } from '@tanstack/svelte-devtools'
220</script>
221β
222<main>
223 <!-- Your app content -->
224</main>
225<TanStackDevtools />
226```
227β
228To add plugins, define them as an array and pass them via the `plugins` prop. Svelte uses `component` instead of `render` in plugin definitions:
229β
230```svelte
231<script lang="ts">
232 import { TanStackDevtools } from '@tanstack/svelte-devtools'
233 import type { TanStackDevtoolsSveltePlugin } from '@tanstack/svelte-devtools'
234 import { SvelteQueryDevtoolsPanel } from '@tanstack/svelte-query-devtools'
235β
236 const plugins: TanStackDevtoolsSveltePlugin[] = [
237 { name: 'Svelte Query', component: SvelteQueryDevtoolsPanel },
238 ]
239</script>
240β
241<main>
242 <!-- Your app content -->
243</main>
244<TanStackDevtools {plugins} />
245```
246β
247## Angular
248β
249Install the devtools:
250β
251```bash
252npm install @tanstack/angular-devtools
253```
254β
255Add the `TanStackDevtoolsComponent` to the root of your application:
256β
257```typescript
258import { Component } from '@angular/core'
259import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'
260β
261@Component({
262 selector: 'app-root',
263 standalone: true,
264 imports: [TanStackDevtoolsComponent],
265 template: `
266 <app-content />
267 <tanstack-devtools />
268 `,
269})
270export class AppComponent {}
271```
272β
273To add plugins, define them as an array and pass them via the `[plugins]` input. Angular uses `component` instead of `render` in plugin definitions:
274β
275```typescript
276import { Component } from '@angular/core'
277import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'
278import type { TanStackDevtoolsAngularPlugin } from '@tanstack/angular-devtools'
279import { AngularQueryDevtoolsPanel } from '@tanstack/angular-query-devtools'
280β
281@Component({
282 selector: 'app-root',
283 standalone: true,
284 imports: [TanStackDevtoolsComponent],
285 template: `
286 <app-content />
287 <tanstack-devtools [plugins]="plugins" />
288 `,
289})
290export class AppComponent {
291 plugins: Array<TanStackDevtoolsAngularPlugin> = [
292 { name: 'Angular Query', component: AngularQueryDevtoolsPanel },
293 ]
294}
295```
296β
297## Vite Plugin
298β
299All frameworks benefit from the optional Vite plugin, which provides enhanced console logs, go-to-source, and a server event bus. Install it as a dev dependency:
300β
301```bash
302npm install -D @tanstack/devtools-vite
303```
304β
305Add it as the **first** plugin in your Vite config:
306β
307```ts
308import { devtools } from '@tanstack/devtools-vite'
309β
310export default {
311 plugins: [
312 devtools(),
313 // ... rest of your plugins here
314 ],
315}
316```
317β
318For the full list of Vite plugin options, see the [Vite Plugin](./vite-plugin) documentation.