Open History to see the last commit
1---
2title: TanStack Devtools Vue Adapter
3id: adapter
4---
5β
6The Vue adapter wraps `TanStackDevtoolsCore` in a Vue 3 component, using Vue's `<Teleport>` to render plugins and their tab titles into the correct DOM containers managed by the devtools shell.
7β
8## Installation
9β
10```sh
11npm install @tanstack/vue-devtools
12```
13β
14## Component Props
15β
16The `TanStackDevtools` component accepts the following props, defined by the `TanStackDevtoolsVueInit` interface:
17β
18| Prop | Type | Description |
19| --- | --- | --- |
20| `plugins` | `TanStackDevtoolsVuePlugin[]` | Array of plugins to render inside the devtools panel. |
21| `config` | `Partial<TanStackDevtoolsConfig>` | Configuration for the devtools shell. Sets the initial state on first load; afterwards settings are persisted in local storage. |
22| `eventBusConfig` | `ClientEventBusConfig` | Configuration for the TanStack Devtools client event bus. |
23β
24## Plugin Type
25β
26Each plugin in the `plugins` array must conform to the `TanStackDevtoolsVuePlugin` type:
27β
28```ts
29type TanStackDevtoolsVuePlugin = {
30 id?: string
31 component: Component
32 name: string | Component
33 props?: Record<string, any>
34}
35```
36β
37| Field | Type | Description |
38| --- | --- | --- |
39| `id` | `string` (optional) | Unique identifier for the plugin. |
40| `component` | `Component` | The Vue component to render as the plugin panel content. |
41| `name` | `string \| Component` | Display name for the tab title. Can be a plain string or a Vue component for custom rendering. |
42| `props` | `Record<string, any>` (optional) | Additional props passed to the plugin component via `v-bind`. |
43β
44## Key Difference from React
45β
46The Vue adapter uses `component` (a Vue component reference) instead of `render` (a JSX element) in plugin definitions. Props are provided through the `props` field and bound to the component with `v-bind`, rather than being embedded directly in a JSX expression.
47β
48```vue
49<!-- Vue: pass component reference + props -->
50<script setup lang="ts">
51import { TanStackDevtools } from '@tanstack/vue-devtools'
52import { VueQueryDevtoolsPanel } from '@tanstack/vue-query-devtools'
53β
54const plugins = [
55 {
56 name: 'Vue Query',
57 component: VueQueryDevtoolsPanel,
58 props: { style: 'height: 100%' },
59 },
60]
61</script>
62β
63<template>
64 <TanStackDevtools :plugins="plugins" />
65</template>
66```
67β
68## Exports
69β
70The `@tanstack/vue-devtools` package exports:
71β
72- **`TanStackDevtools`** -- The main Vue component that renders the devtools panel.
73- **`TanStackDevtoolsVuePlugin`** (type) -- The type for plugin definitions.
74- **`TanStackDevtoolsVueInit`** (type) -- The props interface for the `TanStackDevtools` component.
75β
76The package depends on `@tanstack/devtools` (the core package), which provides `TanStackDevtoolsCore`, `TanStackDevtoolsConfig`, `ClientEventBusConfig`, and other core utilities.