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

plugin-configuration.md

49 lines1.7 KB

1---
2title: Plugin Configuration
3id: plugin-configuration
4---
5
6​
7# Plugin Configuration
8​
9You can configure TanStack Devtools plugins by passing them as an array to the `plugins` prop of the `TanStackDevtools` component.
10​
11Each plugin can have the following configuration options:
12- `name` (required) - A name to be displayed in the devtools UI.
13- `render` (required) - A React component that renders the plugin's UI.
14- `defaultOpen` (optional) - A boolean that determines if the plugin panel is open by default (default: false).
15- `id` (optional) - A unique identifier for the plugin. If not provided, a random id will be generated.
16​
17Here's an example of how to configure plugins in the `TanStackDevtools` component:
18​
19```tsx
20import { TanStackDevtools } from '@tanstack/react-devtools'
21import { FormDevtools } from '@tanstack/react-form-devtools'
22​
23function App() {
24 return (
25 <>
26 <YourApp />
27 <TanStackDevtools
28 plugins={[
29 {
30 name: 'TanStack Form',
31 render: <FormDevtools />,
32 defaultOpen: true,
33 },
34 ]}
35 />
36 </>
37 )
39```
40​
41## Default open
42​
43You can set a plugin to be open by default by setting the `defaultOpen` property to `true` when configuring the plugin. This will make the plugin panel open when the devtools are first loaded.
44​
45If you only have 1 plugin it will automatically be opened regardless of the `defaultOpen` setting.
46​
47The limit to open plugins is at 3 panels at a time. If more than 3 plugins are set to `defaultOpen: true`, only the first 3 will be opened.
48​
49This does not override the settings saved in localStorage. If you have previously opened the plugin panel, and selected some plugins to be open or closed, those settings will take precedence over the `defaultOpen` setting.