You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** URL to load in the iframe (for type: 'iframe') */
76
77
url?:string
77
78
/** Action configuration (for type: 'action') */
@@ -86,6 +87,8 @@ interface DockEntry {
86
87
buttonStart?:string
87
88
buttonLoading?:string
88
89
}
90
+
/** JsonRenderer handle created by ctx.createJsonRenderer() (for type: 'json-render') */
91
+
ui?:JsonRenderer
89
92
}
90
93
```
91
94
@@ -296,6 +299,48 @@ ctx.docks.register({
296
299
> [!NOTE]
297
300
> Built-in logs panel (`~logs`) is currently reserved and hidden while log UI is under development.
298
301
302
+
## JSON Render Panels
303
+
304
+
JSON render panels let you describe your UI as a JSON spec on the server side — **no client code needed.** This is the simplest way to add a DevTools panel.
305
+
306
+
Use `ctx.createJsonRenderer()` to create a renderer handle, then pass it as `ui` when registering a `json-render` dock entry:
307
+
308
+
```ts
309
+
const ui =ctx.createJsonRenderer({
310
+
root: 'root',
311
+
elements: {
312
+
root: {
313
+
type: 'Stack',
314
+
props: { direction: 'vertical', gap: 12 },
315
+
children: ['heading', 'info'],
316
+
},
317
+
heading: {
318
+
type: 'Text',
319
+
props: { content: 'Hello from JSON!', variant: 'heading' },
320
+
},
321
+
info: {
322
+
type: 'KeyValueTable',
323
+
props: {
324
+
entries: [
325
+
{ key: 'Version', value: '1.0.0' },
326
+
{ key: 'Status', value: 'Running' },
327
+
],
328
+
},
329
+
},
330
+
},
331
+
})
332
+
333
+
ctx.docks.register({
334
+
id: 'my-panel',
335
+
title: 'My Panel',
336
+
icon: 'ph:chart-bar-duotone',
337
+
type: 'json-render',
338
+
ui,
339
+
})
340
+
```
341
+
342
+
See the [JSON Render](/kit/json-render) page for the full component reference, dynamic updates, actions, state bindings, and examples.
343
+
299
344
## Communication with Server
300
345
301
346
All client scripts (actions and custom renderers) can communicate with the server using [RPC](./rpc):
0 commit comments